Skip to content

Instantly share code, notes, and snippets.

# create stub, then run flask app in tornado on port 5000 (perhaps with supervisord config below http://supervisord.org/index.html)
#!/usr/bin/env python
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from myflaskapp import app
http_server = HTTPServer(WSGIContainer(app))
@jankuo
jankuo / nginx
Created March 15, 2013 07:43 — forked from hisea/nginx
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
@jankuo
jankuo / app.py
Last active October 10, 2015 02:07 — forked from wynemo/nginx.conf
tornado supervisor ubuntu12.04
# -*- coding:utf-8 -*-
import sys, os
import logging
import logging.config
import tornado
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
from tornado.options import define, options, parse_command_line
@jankuo
jankuo / nginx.conf
Created September 4, 2012 01:12 — forked from wynemo/nginx.conf
uwsgi web.py supervisor ubuntu12.04
#partial config
server {
listen 80;
server_name -;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
uwsgi_param UWSGI_PYHOME /home/user/webpy_project_dir/env;
uwsgi_param UWSGI_SCRIPT wsgi;
uwsgi_param UWSGI_CHDIR /home/user/webpy_project_dir/;