From 6f17343e23b3a04d3cbf47e1aa1063b76426677d Mon Sep 17 00:00:00 2001 From: Jeffrey Forman Date: Thu, 8 Mar 2012 22:35:13 -0500 Subject: [PATCH] Add working django.wsgi and apache config file for inclusion --- .gitignore | 1 + config/binder-apache.conf.dist | 25 +++++++++++++++++++++++++ config/django.wsgi | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 config/binder-apache.conf.dist create mode 100644 config/django.wsgi diff --git a/.gitignore b/.gitignore index 231486c..b60c53a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.db *.pyc +*.conf \ No newline at end of file diff --git a/config/binder-apache.conf.dist b/config/binder-apache.conf.dist new file mode 100644 index 0000000..5cb1c1b --- /dev/null +++ b/config/binder-apache.conf.dist @@ -0,0 +1,25 @@ + + ServerName binder.yourdomain.org + + # The first argument to WSGIScriptAlias is the absolute path + # under your domain where Binder lives. + # The second argument is the absolute path to the django.wsgi file + # from the Binder checkout. + WSGIScriptAlias / /opt/binder/config/django.wsgi + + # The second argument to this alias should be the absolute path + # to the 'files/static' directory under a Binder checkout. + # This is where various CSS files live. + Alias /files/static /opt/binder/binder/files/static + + Order allow,deny + Allow from all + + + Alias /media /usr/lib/pymodules/python2.7/django/contrib/admin/media + + Order allow,deny + Allow from all + + + diff --git a/config/django.wsgi b/config/django.wsgi new file mode 100644 index 0000000..e0dd3bd --- /dev/null +++ b/config/django.wsgi @@ -0,0 +1,13 @@ +# This file specifies needed environment and configuration +# data for the Binder app to operate under mod_wsgi. + +import os +import sys + +PROJECT_PATH=os.path.realpath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.append(PROJECT_PATH) +sys.path.append(os.path.join(PROJECT_PATH, "binder")) + +os.environ['DJANGO_SETTINGS_MODULE'] = 'binder.settings' +import django.core.handlers.wsgi +application = django.core.handlers.wsgi.WSGIHandler()