forked from comp523/ITVS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsgi.py
26 lines (21 loc) · 780 Bytes
/
wsgi.py
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
#!/usr/bin/python
import os
virtenv = os.path.join(os.environ.get('OPENSHIFT_PYTHON_DIR','.'), 'virtenv')
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
with open(virtualenv) as f:
code = compile(f.read(), "somefile.py", 'exec')
exec(code, dict(__file__=virtualenv))
except IOError:
print("This doesn't work")
pass
#
# IMPORTANT: Put any additional includes below this line. If placed above this
# line, it's possible required libraries won't be in your searchable path
#
from ranalyze import flask_app as application
if __name__ == '__main__':
from wsgiref.simple_server import make_server
httpd = make_server('localhost', 8051, application)
# Wait for a single request, serve it and quit.
httpd.serve_forever()