Skip to content

Commit f15864a

Browse files
authored
Improve discoverability of dj-database-url's env option (#224)
In cases where something other than the `DATABASE_URL` needs to be set, it was previously hard to know how to customise `dj-database-url`'s config, since the upstream docs don't mention the `env` option. Now our default config passes an explicit value for `env` (which matches the default value for that argument), to improve discoverability. In addition, the Heroku Postgres docs link has been updated to deep link to the env vars section, which explains when/why DB env vars will be given alternate colour-prefixed names. Closes #221.
1 parent 010c942 commit f15864a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: gettingstarted/settings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@
115115
# In production on Heroku the database configuration is derived from the `DATABASE_URL`
116116
# environment variable by the dj-database-url package. `DATABASE_URL` will be set
117117
# automatically by Heroku when a database addon is attached to your Heroku app. See:
118-
# https://devcenter.heroku.com/articles/provisioning-heroku-postgres
118+
# https://devcenter.heroku.com/articles/provisioning-heroku-postgres#application-config-vars
119119
# https://github.com/jazzband/dj-database-url
120120
DATABASES = {
121121
"default": dj_database_url.config(
122+
env="DATABASE_URL",
122123
conn_max_age=600,
123124
conn_health_checks=True,
124125
ssl_require=True,

0 commit comments

Comments
 (0)