1

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?

0

2 Answers 2

5

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""

Sign up to request clarification or add additional context in comments.

Comments

2

If you use Linux you could set variable in environment via:

 $ export DATABASE_URL="postgresql://localhost/yourdatabase"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.