-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwsgi_example.py
24 lines (19 loc) · 890 Bytes
/
wsgi_example.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
#!/usr/bin/python
# https://www.zoe.vc/2010/django-with-virtualenv-on-webfaction/
import os, sys, site
# add virtualenv python libs
site.addsitedir('/home/<yourusername>/webapps/<yourappname>/<yourvirtualenvname>/lib/python2.7/site-packages')
# append the project path to system path
sys.path.append('/home/<yourusername>/webapps/<yourappname>/<yourvirtualenvname>/')
sys.path.append('/home/<yourusername>/webapps/<yourappname>/<yourvirtualenvname>/<yourprojectname>')
# set the settings module
os.environ['DJANGO_SETTINGS_MODULE'] = '<yourprojectname>.settings'
# init the wsgi handler
# from django.core.handlers.wsgi import WSGIHandler
# application = WSGIHandler()
from django.core.handlers.wsgi import WSGIHandler
import pinax.env
# setup the environment for Django and Pinax
pinax.env.setup_environ(__file__)
# set application for WSGI processing
application = WSGIHandler()