-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not clear how to reference HEROKU_POSTGRESQL_GREEN_URL and other color db variables. #221
Comments
@DavidPratten Hi! Thank you for the feedback. The default env var is always named In your case, were you intentionally using multiple databases (and so wanting to understand how to adapt this codebase for that use-case), or were you following the tutorial and had accidentally added multiple DBs? |
Hi Ed,
When I created my instance, I created just a single database, and only
once, and Heroku added it as a color name. I agree that this is not what
the documentation says should happen.
All the best,
David Pratten
…On Tue, 21 May 2024 at 1:24 AM, Ed Morley ***@***.***> wrote:
@DavidPratten <https://github.com/DavidPratten> Hi! Thank you for the
feedback.
The default env var is always named DATABASE_URL for the first database
added to the app. The additional colour name variants are only seen when
multiple databases are added, per:
https://devcenter.heroku.com/articles/provisioning-heroku-postgres#application-config-vars
In your case, were you intentionally using multiple databases (and so
wanting to understand how to adapt dj_database_url to that use-case, or
were you following the tutorial and had accidentally added multiple DBs?
—
Reply to this email directly, view it on GitHub
<#221 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMXEL4PE4IEDGMIBTRFPEDZDIIS7AVCNFSM6AAAAABH5FPE42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQGY4DEOBTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi David If you run Also, was your Heroku account created before May 15, 2023? Since older accounts have a legacy auto-provisioning feature enabled, though the tutorial content on Dev Center has been written in such a way that the auto-provisioning shouldn't occur for older accounts, so long as the tutorial is followed in sequence. |
Hi Ed, No. Its a new account. When I created my instance, I created just a single database, and only once, and Heroku added it as a color name. David |
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.
Ok that's very strange - not sure what happened in your case. I've just merged #224 which hopefully improves the UX in this case. |
I also filed jazzband/dj-database-url#248 |
Awesome, thanks for the update!
…On Fri, 24 May 2024 at 10:18 PM, Ed Morley ***@***.***> wrote:
I also filed jazzband/dj-database-url#248
<jazzband/dj-database-url#248>
—
Reply to this email directly, view it on GitHub
<#221 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMXELZDKSKPFLFWRELHXJDZD4VXVAVCNFSM6AAAAABH5FPE42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZGM4TMMZRG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
While https://github.com/heroku/python-getting-started/blob/main/gettingstarted/settings.py says
in actual fact this wasn't true in my case. The variable was called
HEROKU_POSTGRESQL_GREEN_URL
I expect that future noobie users will be assisted if the example calls out the variability in the naming of the
DATABASE_URL
environment variable and shows how to discover what it is called and how to incorporate the actual name.Something like this:
The text was updated successfully, but these errors were encountered: