Answer the question
In order to leave comments, you need to log in
How to update postgressql url python?
Hello!
I have a problem, my code is connecting to the database via the postgressql url on heroku, but since heroku is updating the authorization data (the url has definitely changed), how can i get the working url?
I tried to create a bat file by writing it in heroku config:get
and updating the DB_URL variable with the received data, but it’s impossible to run bat on Heroku because it works on linux (unfortunately I found out just now)
Answer the question
In order to leave comments, you need to log in
https://devcenter.heroku.com/articles/connecting-h...
import os
import psycopg2
DATABASE_URL = os.environ['DATABASE_URL']
conn = psycopg2.connect(DATABASE_URL, sslmode='require')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question