Skip to content

Instantly share code, notes, and snippets.

@dolugen
Created March 12, 2013 03:10
Show Gist options
  • Save dolugen/5140012 to your computer and use it in GitHub Desktop.
Save dolugen/5140012 to your computer and use it in GitHub Desktop.
a wsgi.py template for deploying virtualenv django project
import os
import sys⋅
import site
site.addsitedir('/home/user/.virtualenvs/venv/lib/python2.7/site-packages/')
activate_this = os.path.expanduser("~/.virtualenvs/venv/bin/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))
from django.core.handlers.wsgi import WSGIHandler
sys.path.append('/home/user/apps/venv/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
application = WSGIHandler()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment