forked from BenMotz/cubetoolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolkit.wsgi
More file actions
27 lines (18 loc) · 722 Bytes
/
toolkit.wsgi
File metadata and controls
27 lines (18 loc) · 722 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
import os
import sys
import site
VIRTUALENV="venv"
# Get site root from this file's location:
SITE_ROOT=os.path.abspath(os.path.dirname(__file__))
# Add virtualenv path to site package root:
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.7/site-packages"))
site.addsitedir(os.path.join(SITE_ROOT, VIRTUALENV, "lib/python2.6/site-packages"))
# Add site package root to start of pythonpath:
sys.path.insert(0, SITE_ROOT)
# celery should now be available (on the virtualenv path)
import djcelery
djcelery.setup_loader()
# Point Django to settings file:
os.environ['DJANGO_SETTINGS_MODULE'] = 'toolkit.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()