Created
March 23, 2012 17:20
-
-
Save jessejlt/2172941 to your computer and use it in GitHub Desktop.
Flask + nginx + uwsgi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
include uwsgi_params; | |
uwsgi_pass 127.0.0.1:4050; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
# routes | |
if __name__ == '__main__': | |
# debug | |
# app.run(host='0.0.0.0', port=4050, debug=True) | |
# release | |
app.run(host='0.0.0.0', port=4050) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:my_server] | |
command=uwsgi --socket 127.0.0.1:4050 --file /usr/lib/python2.6/site-packages/my_server/server.py --callable app --processes 2 --touch-reload / | |
etc/my_server-reload-trigger.txt | |
process_name=my_server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment