Basic flask app, need to hup nginx and start a wsgi server in a minute.

This commit is contained in:
Joshua McKenty
2013-04-16 09:54:39 -07:00
parent 6f85ff99c0
commit acec5e7011
5 changed files with 66 additions and 0 deletions

31
refstack/web.py Normal file
View File

@@ -0,0 +1,31 @@
# LICENSE HERE
"""
Simple Refstack website.
"""
import os
import sys
import random
from flask import Flask, request, render_template, g, jsonify
from twisted.internet import task
from twisted.internet import reactor
from twisted.web.wsgi import WSGIResource
from twisted.web.server import Site
PORT = 80
app = Flask(__name__)
app.debug = True
@app.route('/', methods=['POST','GET'])
def index():
return render_template('index.html')
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)
app.listeningPort = reactor.listenTCP(PORT, site)
reactor.run()