I'm working on cs50 project1 (js & python), I download the project, and found this line in it:
engine = create_engine(os.getenv("DATABASE_URL"))
the question is how to set up the DATABASE_URL?
I'm working on cs50 project1 (js & python), I download the project, and found this line in it:
engine = create_engine(os.getenv("DATABASE_URL"))
the question is how to set up the DATABASE_URL?
add this code after initialising your app:
app.config['DATABASE_URL'] = "path_to_db"
Or export it by running in your command line:
export DATABASE_URL=""postgres://user:password@server_ip:5432/table_name""
If you use Linux you could set variable in environment via:
$ export DATABASE_URL="postgresql://localhost/yourdatabase"