-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathindex.wsgi
38 lines (30 loc) · 1005 Bytes
/
index.wsgi
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
30
31
32
33
34
35
36
37
38
#for sae
import os, sys
import django.core.handlers.wsgi
import sae
HERE = os.path.dirname(os.path.abspath(__file__))
TO_ABS_PATH = lambda p: os.path.join(HERE, p)
sys.path.insert(0, HERE)
#sys.path.insert(0, TO_ABS_PATH('libs/virtualenv.bundle.zip'))
sys.path.insert(0, TO_ABS_PATH('libs'))
###! Copied form DPress.sites.index.wsgi
import tempfile
#tempfile.tempdir = 'tempdir'
#tempfile.tempdir = sae.core.get_tmp_dir()
import StringIO
class StringIOExt(StringIO.StringIO):
name = ""
size = 0
def TemporaryFile(mode='w+b', bufsize=-1, suffix="",
prefix='', dir=None, delete=True):
#f = StringIO.StringIO()
f = StringIOExt()
return f
tempfile.TemporaryFile = TemporaryFile
tempfile.NamedTemporaryFile = TemporaryFile
####! End Copied form DPress.sites.index.wsgi
import sae
import sae.storage
import django.core.handlers.wsgi
os.environ['DJANGO_SETTINGS_MODULE'] = 'ezlog.settings'
application = sae.create_wsgi_app(django.core.handlers.wsgi.WSGIHandler())