9
I'm trying to push a django app to heroku and getting an error that I haven't seen anywhere in the heroku or stackoverflow forums. I'm using postgres.
I'm not sure where to proceed; I see nothing in any of the docs that says what is wrong. The main error is:
ImportError: No module named psycopg2.extensions
...but heroku's configuration is the one that is setting that as the ENGINE, I don't know how to get by it.
My conversation with heroku to make sure it knows about postgres
$ heroku addons:add heroku-postgresql:dev
Adding heroku-postgresql:dev on morning-crag-1585... done, v24 (free)
Attached as HEROKU_POSTGRESQL_OLIVE_URL
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pgbackups:restore.
.
Use `heroku addons:docs heroku-postgresql:dev` to view documentation.
$ heroku pg:wait
$ heroku config | grep HEROKU_POSTGRESQL
HEROKU_POSTGRESQL_OLIVE_URL: postgres://<blah-blah-blah>@ec2-<ip-address>.compute-1.amazonaws.com:5432/<blah-blah>
$ heroku pg:promote HEROKU_POSTGRESQL_OLIVE_URL
Promoting HEROKU_POSTGRESQL_OLIVE_URL to DATABASE_URL... done
My requirements.txt:
Django==1.4.2
wsgiref==0.1.2
dj-database-url==0.2.1
A snippet from my settings.py:
print "Got here before!\n"
try:
import dj_database_url
DATABASES = { 'default': dj_database_url.config(default='postgres://localhost') }
except:
print "Unexpected error:", sys.exc_info()
print DATABASES
When I push to heroku, I get this from heroku logs:
heroku[slugc]: Slug compilation finished
heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:30550 --noreload`
app[web.1]: Got here before!
app[web.1]:
app[web.1]: {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '<blah blah>