Error was: No module named postgresql.base
<p>I'm trying to migrate a Django app to postgresql, but I'm having trouble getting Django to recognize that postgres is actually installed.  I've installed it on my machine, and it is running on my computer fine, but when I try to set it as the default in my <code>settings.py</code>, I get the error:</p>

<blockquote>
  <p>Error was: No module named postgresql.base</p>
</blockquote>

<p>I've gone through two walkthroughs on getting postgresql running with Django <a href="https://gist.github.com/panuta/1852087" rel="noreferrer">here</a> and <a href="https://djangogirls.gitbooks.io/django-girls-tutorial-extensions/content/optional_postgresql_installation/index.html" rel="noreferrer">here</a>, but I continue to get this error. Am I supposed to have an installation of postgresql in my virtual environment?  I've tried doing that, but no luck.</p>

<p><code>settings.py</code></p>

<pre><code>DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'pygamers',
        'USER': 'myusername',
        'PASSWORD': '',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}
</code></pre>

<p>The full traceback</p>

<pre><code>Unhandled exception in thread started by &lt;function wrapper at 0x10ab64410&gt;
Traceback (most recent call last):
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/userprofile/models.py", line 2, in &lt;module&gt;
    from django.contrib.auth.models import User
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in &lt;module&gt;
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 49, in &lt;module&gt;
    class AbstractBaseUser(models.Model):
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/db/models/base.py", line 108, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/db/models/base.py", line 299, in add_to_class
    value.contribute_to_class(cls, name)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/db/models/options.py", line 263, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/db/__init__.py", line 36, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/db/utils.py", line 212, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Users/tomeldridge/Desktop/Misc/Hobbies/Programming/Projects/Pygamers/venv/lib/python2.7/site-packages/django/db/utils.py", line 135, in load_backend
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.postgresql' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'sqlite3'
Error was: No module named postgresql.base
</code></pre>