title: Getting Django and PostgreSQL to work
body: <p>I am trying to get Django and PostgreSQL to work.</p>
  
  <p>So far I am getting the following error when I run <code>syncdb</code>.</p>
  
  <pre><code>....
  django.core.exceptions.ImproperlyConfigured:
  Error loading psycopg2 module: No module named psycopg2
  </code></pre>
  
  <p>The following is my <code>settings.py</code>.</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
          'NAME': 'mydb',                      # Or path to database file if using sqlite3.
          'USER': 'username',                  # Not used with sqlite3.
          'PASSWORD': 'pwd123',                # Not used with sqlite3.
          'HOST': 'localhost',                 # Set to empty string for localhost. Not used with sqlite3.
          'PORT': '5432',                      # Set to empty string for default. Not used with sqlite3.
      }
  }
  </code></pre>
  
  <p>I think I have installed psycopg2 correctly, but I am not sure (through MacPorts).</p>
  
  <p>Is there a way whether I can check whether psycopg2 is installed?</p>
  
  <p><a href="http://codepaste.net/hpyhjp" rel="nofollow">This link contains the install log of psycopg2</a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I got it working with the method below, but how do I check whether psycopg2 was actually installed before? and if so how to remove it completely?</p>