Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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""
Add a comment
If you use Linux you could set variable in environment via:
$ export DATABASE_URL="postgresql://localhost/yourdatabase"
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.