title: Setup postgresql for django in windows
body: <p>I'm learning django and here I'm trying to change the database from the default sqlite3 to postgresql. I've searched all over the internet(google,bing,duckduckgo,..) but no results.</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': 'websitedb',
          'USER': 'postgres',
          'PASSWORD': 'teamarrow',
          'HOST': 'localhost',
          'PORT': '5432',
      }
  }`  
  </code></pre>
  
  <p>Changed the database in settings.py,
  Installed postgresql,installed psycopg2 for windows from <a href="http://www.stickpeople.com/projects/python/win-psycopg/" rel="noreferrer">here</a>,
  Created a new database in pgADMINIII.</p>
  
  <p>In command prompt <code>python manage.py runserver</code>. This is the error:</p>
  
  <pre><code> ` Traceback (most recent call last): 
   File "manage.py", line 10, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\core\management\__ini
  t__.py", line 385, in execute_from_command_line
      utility.execute()
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\core\management\__ini
  t__.py", line 354, in execute
      django.setup()
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\__init__.py", line 21
  , in setup
      apps.populate(settings.INSTALLED_APPS)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\apps\registry.py", li
  ne 108, in populate
      app_config.import_models(all_models)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\apps\config.py", line
   202, in import_models
      self.models_module = import_module(models_module_name)
    File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
      __import__(name)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\contrib\auth\models.p
  y", line 40, in &lt;module&gt;
      class Permission(models.Model):
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\models\base.py", l
  ine 122, in __new__
      new_class.add_to_class('_meta', Options(meta, **kwargs))
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\models\base.py", l
  ine 297, in add_to_class
      value.contribute_to_class(cls, name)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\models\options.py"
  , line 166, in contribute_to_class
      self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\__init__.py", line
   40, in __getattr__
      return getattr(connections[DEFAULT_DB_ALIAS], item)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\utils.py", line 24
  2, in __getitem__
      backend = load_backend(db['ENGINE'])
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\utils.py", line 10
  8, in load_backend
      return import_module('%s.base' % backend_name)
    File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
      __import__(name)
    File "C:\Users\Admin\Pictures\website\lib\site-packages\django\db\backends\postgresq
  l_psycopg2\base.py", line 27, in &lt;module&gt;
      raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
  django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module n
  amed psycopg2
  </code></pre>
  
  <p>Please debug where the error is.</p>