Created
February 20, 2012 23:45
-
-
Save varikin/1872346 to your computer and use it in GitHub Desktop.
Example WSGI file for mod_wsgi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, sys, site | |
| # Adds the virtualenv library to the path | |
| ENV_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) | |
| site.addsitedir(os.path.join(ENV_PATH, 'lib','python2.6','site-packages')) | |
| # Adds the project to the path | |
| # Note that depending on the location of this file, PROJECT_PATH might change | |
| PROJECT_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) | |
| sys.path.append(PROJECT_PATH) | |
| 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