-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathmoai.wsgi
More file actions
29 lines (23 loc) · 815 Bytes
/
Copy pathmoai.wsgi
File metadata and controls
29 lines (23 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys
import os
import site
import tempfile
import ConfigParser
os.environ['PYTHON_EGG_CACHE'] = tempfile.mkdtemp(prefix='moai-egg-cache-')
site.addsitedir(os.path.join(os.path.abspath(os.path.dirname(__file__)),
'lib',
'python%d.%d' % sys.version_info[:2],
'site-packages'))
from paste.deploy import loadapp
if sys.version_info >= (2, 6):
from logging.config import fileConfig
else:
from paste.script.util.logging_config import fileConfig
config_file = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'settings.ini')
try:
fileConfig(config_file)
except ConfigParser.NoSectionError:
# no logging configured
pass
application = loadapp('config:%s' % config_file)