Flask Gunicorn app can't get __name__ to equal '__main__'
问题 I have this from /home/myname/myapp/app.py : from flask import Flask app = Flask(__name__) print __name__ @app.route(\'/\') def index(): return \"Hello world!\" if __name__ == \'__main__\': print \'in if\' app.run() When I run: $ gunicorn app:app -b 127.0.0.2:8000 It says: 2013-03-01 11:26:56 [21907] [INFO] Starting gunicorn 0.17.2 2013-03-01 11:26:56 [21907] [INFO] Listening at: http://127.0.0.2:8000 (21907) 2013-03-01 11:26:56 [21907] [INFO] Using worker: sync 2013-03-01 11:26:56 [21912]