Python sets __name__
to "__main__"
when the script is the entry point for the Python interpreter. Since Gunicorn imports the script it is running that script will not be the entry point and so will not have __name__
set to "__main__"
.
More Related Contents:
- Are a WSGI server and HTTP server required to serve a Flask app?
- Flask application traceback doesn’t show up in server log
- How many concurrent requests does a single Flask process receive?
- Debugging a Flask app running in Gunicorn
- Restrict static file access to logged in users
- Gunicorn, no module named ‘myproject
- How to run Flask with Gunicorn in multithreaded mode
- X-Forwarded-Proto and Flask
- Gunicorn can’t find app when name changed from “application”
- How to use Flask-Script and Gunicorn
- How do I run a long-running job in the background in Python
- Sharing a lock between gunicorn workers
- Flask raises TemplateNotFound error even though template file exists
- Reference template variable within Jinja expression
- Is the server bundled with Flask safe to use in production?
- Handle Flask requests concurrently with threaded=True
- Make a POST request while redirecting in flask
- redirect while passing arguments
- What is the purpose of Flask’s context stacks?
- error: [Errno 10053]
- Why does the session cookie work when serving from a domain but not when using an IP?
- Flask and uWSGI – unable to load app 0 (mountpoint=”) (callable not found or import error)
- Method Not Allowed flask error 405
- CSS Problems with Flask Web App
- flask-sqlalchemy or sqlalchemy
- secret key not set in flask session, using the Flask-Session extension
- Slow Requests on Local Flask Server
- Nested Blueprints in Flask?
- Which SQLAlchemy column type should be used for binary data?
- Opening csv file in Python using Flask