On 12/6/19 9:09 PM, Jorge Gimeno wrote:
On Fri, Dec 6, 2019 at 5:40 PM Tim Johnson <[email protected]
<mailto:[email protected]>> wrote:
Despite the voluminous Heroku documentation I am unable to establish
where to initialize the DATABASE_URL that would establish credentials
for my deployed database.
Heroku's documentation uses the following example
DATABASE_URL=$(heroku config:get HEROKU_POSTGRESQL_TIMS_URL -a
timsapp)
But I am not clear where this initialization code should live
would it be in the procfile? If so, what process should I use.
Release?
Worker?
OR
Would it be in an .env file?
... snip ...
I believe DATABASE_URL is set on Heroku itself as a configuration
variable. If you provision the database in Heroku, it will be set for
you. See here:
https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres
Thank you Jorge, I have read that section too:
The following is highlighted as a warning on that:
"""
The value of your app’s |DATABASE_URL| config var might change at any time.
You should not rely on this value either inside or outside your Heroku app.
"""
that is precisely why I have asked this question.
more discussion of this issue is found at
https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku
and a search for "DATABASE_URL=$(" will give an example of how to set
DATABASE_URL from the Heroku command line.
That approach begs for a script but I am unsure of what script file to
use. .env or Procfile or some other.
Thanks again Jorge
--
Tim
tj49.com
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/14cf27a4-eb56-5925-fcf8-50ca3344f9e8%40akwebsoft.com.