# HG changeset patch # User Matt Johnston # Date 1430912437 -28800 # Node ID abc837a7e60fe2704abe97827b954af90d7679fe # Parent 88dfac30d06558cdca7640095aaeca7eef054237 gevent seems to work diff -r 88dfac30d065 -r abc837a7e60f 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 88dfac30d065 -r abc837a7e60f 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