annotate web/templog.wsgi @ 539:b78961d2e3a3

gevent seems to work
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 May 2015 19:40:37 +0800
parents 910324f14fe4
children 509a1be16456
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
539
b78961d2e3a3 gevent seems to work
Matt Johnston <matt@ucc.asn.au>
parents: 410
diff changeset
1 from gevent import monkey; monkey.patch_all()
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()