Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Created February 7, 2013 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdamusic/4734282 to your computer and use it in GitHub Desktop.
Save lambdamusic/4734282 to your computer and use it in GitHub Desktop.
Django: Adding custom django package to WSGI settings
# in your project.wsgi file
import os, sys
#add the desired django version at the beginning of the path; mind you must provide the Django folder as downloaded!
sys.path.insert(1, "/path/to/Django/")
sys.path.append('/my/project/root/') # add things as usual...
# the rest is the normal wsgi stuff...
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment