1

My sqlite DB is on Ubuntu at

(venv)jisoo@jisoo:~totalAirQREST/totalAirRunDB$

How can I specify the location of the DB in sqlalchemy?

My app.py located in totalAirQREST has the following.

app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL','sqlite:///airQuality.db')

I know I have to change from the sqlite:///airQuality.db, to sqlite:////totalAirRunDB/airQuality.db. But it turns out it is not working. Please help me how to get the app know the location of the sqlite DB.

1 Answer 1

2

Try full path

app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL','sqlite:////home/jisoo/totalAirQREST/totalAirRunDB/airQuality.db
Sign up to request clarification or add additional context in comments.

2 Comments

You are welcome! Please select it as a correct answer.
I am sorry. Pls. show me how to select it as a correct answer. Do I just press the upward arrow on the left of the answer? Even though I pressed it, nothing changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.