Skip to content

Instantly share code, notes, and snippets.

@haoch
Created October 25, 2012 06:17
Show Gist options
  • Save haoch/3950814 to your computer and use it in GitHub Desktop.
Save haoch/3950814 to your computer and use it in GitHub Desktop.
common wsgi configure file for django application
""" WSGI configure file for django application
Default configure file path: /etc/httpd/conf.d/wsgi.conf """
import os
import sys
## setup path for mod_wsgi
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# add more path here
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
# WSGI configure file for Apache HTTP Server
Listen 80
<VirtualHost *:80>
ServerName server_name
ServerAlias server_alias_name
ServerAlias 127.0.0.1
DocumentRoot /data/...
<Directory /data/...>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / /.../webapp.wsgi
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment