Merge lp:~mhall119/loco-team-portal/add-wsgi into lp:loco-team-portal

Proposed by Michael Hall
Status: Merged
Approved by: Chris Johnston
Approved revision: 488
Merged at revision: 488
Proposed branch: lp:~mhall119/loco-team-portal/add-wsgi
Merge into: lp:loco-team-portal
Diff against target: 25 lines (+21/-0)
1 file modified
loco_directory/django.wsgi (+21/-0)
To merge this branch: bzr merge lp:~mhall119/loco-team-portal/add-wsgi
Reviewer Review Type Date Requested Status
Chris Johnston Approve
Review via email: mp+78598@code.launchpad.net

Commit message

Adds a wsgi file so we can stop using mod_python

Description of the change

Adds a wsgi file so we can stop using mod_python

To post a comment you must log in.
Revision history for this message
Chris Johnston (cjohnston) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'loco_directory/django.wsgi'
2--- loco_directory/django.wsgi 1970-01-01 00:00:00 +0000
3+++ loco_directory/django.wsgi 2011-10-07 13:48:25 +0000
4@@ -0,0 +1,21 @@
5+import os
6+import sys
7+
8+import django.core.handlers.wsgi
9+
10+# add path to sttings to system path if not already there
11+# check if path is already there to avoid path duplication when
12+# modwsgi is configured for code reloading
13+curdir = os.path.abspath(os.path.dirname(__file__))
14+if curdir not in sys.path:
15+ sys.path.append(curdir)
16+parentdir = os.path.join(curdir, '..')
17+if parentdir not in sys.path:
18+ sys.path.append(parentdir)
19+
20+# setup environment
21+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
22+
23+# setup application
24+application = django.core.handlers.wsgi.WSGIHandler()
25+

Subscribers

People subscribed via source and target branches