Skip to content

Instantly share code, notes, and snippets.

@luisfredgs
Forked from JuniorLima/projeto.wsgi
Created January 21, 2016 04:11
Show Gist options
  • Save luisfredgs/8e28e78b6f6c81da85af to your computer and use it in GitHub Desktop.
Save luisfredgs/8e28e78b6f6c81da85af to your computer and use it in GitHub Desktop.
WSGI Kinghost
import os
import sys
import site
# Calculates the path based on location of WSGI script.
apache_configuration = os.path.realpath(os.path.dirname(__file__))
project = os.path.join(apache_configuration, 'nomedoproto')
sys.path.append(apache_configuration)
sys.path.append(project)
site.addsitedir('/home/nomedoprojeto/apps_wsgi/.site-packages')
os.environ['PYTHON_EGG_CACHE'] = '/home/nomedoprojeto/apps_wsgi/.python-eggs'
os.environ['DJANGO_SETTINGS_MODULE'] = 'nomedoprojeto.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