I have this from /home/myname/myapp/app.py:
/home/myname/myapp/app.py
from flask import Flask app = Flask(__name__) print __name__ @app.route(\'/\') def index(): r
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__".
__name__
"__main__"