heri0n
heri0n

Reputation: 1489

Django/Heroku Settings injection?

I want to be able to change my DATABASES['default'] setting to change automatically when I deploy to heroku. Is there some way to do this?

This looks like what I want https://devcenter.heroku.com/articles/django-injection, but it seems like it no longer works as of July 1, 2012.

Upvotes: 0

Views: 274

Answers (1)

mipadi
mipadi

Reputation: 410662

Use dj_database_url, as described here. To wit:

$ pip install dj-database-url

and then in settings.py:

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

You can pass config a default argument if you don't want to set DATABASE_URL locally. More info is available here.

Upvotes: 1

Related Questions