Skip to content

Instantly share code, notes, and snippets.

@fellipeh
Created April 10, 2014 01:58
Show Gist options
  • Save fellipeh/10336699 to your computer and use it in GitHub Desktop.
Save fellipeh/10336699 to your computer and use it in GitHub Desktop.
Erro WSGI
import os
import sys
import site
# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('/home/fellipeh/.virtualenvs/dig/local/lib/python2.7/site-packages')
# Add the app's directory to the PYTHONPATH
sys.path.append('/var/www/django/dig')
sys.path.append('/var/www/django/dig/dig')
# os.environ['DJANGO_SETTINGS_MODULE'] = 'dig.settings'
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dig.settings")
# Activate your virtual env
activate_env=os.path.expanduser("/home/fellipeh/.virtualenvs/dig/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))
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