Skip to content

running flask db from within custom package #3

Answered by nickjj
amouhsine asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Setting FLASK_APP is a requirement of the flask CLI command not this extension.

If you don't set that variable then even running flask --help will throw an error of flask.cli.NoAppException: Could not locate a Flask application. You did not provide the "FLASK_APP" environment variable, and a "wsgi.py" or "app.py" module was not found in the current directory..

You can choose to use a .env file and have that loaded in with python-dotenv (or Docker instead if your app is using it). If you're using systemd you can load in an env file too. This way the user never has to export anything directly. The same goes for any cloud environment like Heroku too.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by amouhsine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants