I am encountering an issue where I am able to run a flask server when using python3 -m flask run
, however it fails to start the server when attempting to launch through the app wsgi.py
.
(Note: I'm trying to omit the project name and the like)
When using python3 -m flask run
:
* Serving Flask app "wsgi.py" (lazy loading)
* Environment: config.DevelopmentConfiguration
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: ___-___-___
* Running on http://0.0.0.0:80/ (Press CTRL+C to quit)
When using python3 wsgi.py
(freezes and does not exit):
* Serving Flask app "[PROJECT_NAME]" (lazy loading)
* Environment: config.DevelopmentConfiguration
* Debug mode: on
wsgi.py
simply calls app.run()
where app is imported from [PROJECT_NAME]
where this code defines it:
app = Flask(__name__)
app.config.from_object( os.environ.get("FLASK_ENV") or 'config.DevelopmentConfiguration'
)
app
is also linked with some resources (e.g. database) and assigned blueprints but I am trying to avoid posting all the code I have, please let me know if you believe that information may be relevant. I noticed that the the app name is different between executions but that is the only lead I see and I am unaware of how that is being assigned but it is the only clue I see at the moment.
So far I have attempted to make the Flask()
initializer take different values and attempted to make sure the correct environment is used but I think that is already correct. I would expect that the server functions the same way when launched via python3 wsgi.py
as with python3 -m flask run
.