annotate web/templog.wsgi @ 562:55cae4f27e75

catch timeout
author Matt Johnston <matt@ucc.asn.au>
date Wed, 10 Jun 2015 00:13:26 +0800
parents 0baa57b6d9ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
540
0f665a84b581 gevent doesn't work well with subprocess
Matt Johnston <matt@ucc.asn.au>
parents: 539
diff changeset
1 #from gevent import monkey; monkey.patch_all()
539
b78961d2e3a3 gevent seems to work
Matt Johnston <matt@ucc.asn.au>
parents: 410
diff changeset
2
391
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 import os
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4 import sys
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 # Change working directory so relative paths (and template lookup) work again
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 thisdir = os.path.dirname(__file__)
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 os.chdir(thisdir)
410
910324f14fe4 - few more web tweaks. don't fsync, it's slow.
Matt Johnston <matt@ucc.asn.au>
parents: 391
diff changeset
8 os.environ['LD_LIBRARY_PATH'] = '/home/matt/templog/web'
391
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 # for some reason local imports don't work...
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 sys.path.append(thisdir)
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 import bottle
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 import templog
5026780c2dc7 - Fix HTTPError
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15 application = bottle.default_app()