S
S
S1riyS2022-02-27 10:51:42
Flask
S1riyS, 2022-02-27 10:51:42

Flask-Migrate not working (Failed to find Flask application or factory in module "app"), how to fix?

The project structure :

621b2bccd4068590531687.png
app/app.py: contains the initialization of the application itself, the database, etc.

run.py:

from app import app

if __name__ == "__main__":
    app.run(port=5000, host='127.0.0.1', debug=True)


When I try to create a migration using the command flask db migrate -m "ADD: transliteration",
I get the error:
Error: Failed to find Flask application or factory in module "app". Use "FLASK_APP=app:name to specify one.


In the config, I specified How to fix this error? FLASK_APP = 'app:app/app.py'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question