finding local postgresql “database_url”

Looking at file main.py line 22 contains "os.environ['DATABASE_URL']" you should set the environment variable DATABASE_URL on your computer to a value that is the location of your database. Eg: set DATABASE_URL=C:\Users\Philip\mydatabasefile


See The docs The general form for a connection URI is:

postgresql://[user[:password]@][netloc][:port][,...][/dbname][?param1=value1&...]

You probably need to set you environment variable DATABASE_URL to something like

set DATABASE_URL=user:password@localhost/dbname

You can display your connection info if logged into postgres shell with command:

\conninfo

this will display the database you are connected to as well as the user logged on

Tags:

Postgresql