Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm new to the Heroku / Django / Postgres game, and running into trouble after following the instructions in their tutorial. Here's my setup:

Installed: Django 1.4.5 dj_database_url Postgress.app 9.2.2.0

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
    'NAME': 'db_name',                      # Or path to database file if using sqlite3.
    'USER': '',                      # Not used with sqlite3.
    'PASSWORD': '',
    'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
    'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
 }
}

and later on in settings.py:

import dj_database_url
    DATABASES['default'] = dj_database_url.config()

When I run python manage.py syncdb:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
   execute_from_command_line(sys.argv)
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-         packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
cursor = connection.cursor()
  File "/Users/joerobinson/.virtualenvs/dg/lib/python2.7/site-packages/django/db/backends/dummy/base.py", line 15, in complain
raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

When I run python manage.py shell, import settings, and look at DATABASES, I get:

{'default': {'ENGINE': 'django.db.backends.dummy', 'TEST_MIRROR': None, 'NAME': '', 'TEST_CHARSET': None, 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'PORT': '', 'HOST': '', 'USER': '', 'TEST_NAME': None, 'PASSWORD':

So I know I must be configuring something improperly, but I haven't found the right settings in a night of searching. Anyone seen this before?

share|improve this question

2 Answers

You probably want a real Django database backend, not django.db.backends.dummy. For example:

{'ENGINE': 'django.db.backends.postgresql_psycopg2', ... }
share|improve this answer
Yes, I definitely want that. Problem is that I'm not sure where django.db.backends.dummy is getting inserted. Must be this line: DATABASES['default'] = dj_database_url.config(). How do I give dj_database_url.config() the database default I set up above? – Joe Feb 26 at 18:36
up vote 0 down vote accepted

I had to point configure the database URL as follows:

DATABASES['default'] = dj_database_url.config(default='postgres://localhost/db_name')

I had other issues relating to the psycopg2 package and gcc-4.2, but those aren't covered by my original post.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.