Install the module dj-database-url and use this in settings instead of the default DATABASES layout, something like:
DATABASES = {'default': dj_database_url.config(os.environ['DATABASE_URL'], conn_max_age=1800)}
Then set DATABASE_URL in the heroku (and your development) environment. This setting will be of the form:
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<databasename>
No comments:
Post a Comment