Skip to content

Instantly share code, notes, and snippets.

@jessejlt
Created March 23, 2012 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessejlt/2172941 to your computer and use it in GitHub Desktop.
Save jessejlt/2172941 to your computer and use it in GitHub Desktop.
Flask + nginx + uwsgi
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:4050;
}
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)
[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