# HG changeset patch # User Matt Johnston # Date 1430912437 -28800 # Node ID b78961d2e3a3ef6afa007f65c5ce5bc838e78f93 # Parent a57f1932f05abc56d3d3151ec136578f525711e9 gevent seems to work diff -r a57f1932f05a -r b78961d2e3a3 web/templog.py --- a/web/templog.py Wed May 06 19:34:23 2015 +0800 +++ b/web/templog.py Wed May 06 19:40:37 2015 +0800 @@ -23,6 +23,16 @@ DATE_FORMAT = '%Y%m%d-%H.%M' ZOOM_SCALE = 2.0 +class TemplogBottle(bottle.Bottle): + def run(*args, **argm): + argm['server'] = 'gevent' + super(TemplogBottle, self).run(*args, **argm) + print "ran custom bottle" + +bottle.default_app.push(TemplogBottle()) + +secure.setup_csrf() + @route('/update', method='post') def update(): js_enc = request.forms.data @@ -133,16 +143,6 @@ response.set_header('Cache-Control', "public, max-age=1296000") return bottle.static_file(filename, root='static') -secure.setup_csrf() - -class TemplogBottle(Bottle): - def run(*args, **argm): - argm['server'] = 'gevent' - super(TemplogBottle, self).run(*args, **argm) - print "ran custom bottle" - -bottle.app().push(TemplogBottle()) - def main(): #bottle.debug(True) #bottle.run(reloader=True) diff -r a57f1932f05a -r b78961d2e3a3 web/templog.wsgi --- a/web/templog.wsgi Wed May 06 19:34:23 2015 +0800 +++ b/web/templog.wsgi Wed May 06 19:40:37 2015 +0800 @@ -1,3 +1,5 @@ +from gevent import monkey; monkey.patch_all() + import os import sys # Change working directory so relative paths (and template lookup) work again