Fix Flask run for applications without app.py #4339
Replies: 2 comments
-
Flask needs an app factory to start your application. By convention the app factory is located in Read more over here: https://flask.palletsprojects.com/en/2.0.x/patterns/appfactories/ I would like to ask you to close the issue since this question is not related to bugs in Flask itself. You will find better luck on getting help with your code on stackoverflow I think. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The issue is that when you want to run an app that doesn't have an app.py file it will throw an error saying
Error: 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.
This is my folder structure
The app is supposed to run even without app.py but if you do python controllers.py it will run on the port.
The Error
Environment:
Beta Was this translation helpful? Give feedback.
All reactions