Added wolnelektury.wsgi to repository.
authorMarek Stępniowski <marek@stepniowski.com>
Tue, 9 Sep 2008 12:31:46 +0000 (14:31 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Tue, 9 Sep 2008 12:31:46 +0000 (14:31 +0200)
Modified project module dirs in settings.py and setpythonpath.sh.

setpythonpath.sh
wolnelektury.wsgi [new file with mode: 0644]
wolnelektury/settings.py

index 2aea8d8..0b4b184 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/sh
-export PYTHONPATH=`pwd`/lib:`pwd`/apps:$PYTHONPATH
\ No newline at end of file
+export PYTHONPATH=`pwd`/lib:`pwd`/apps:`pwd`/wolnelektury:$PYTHONPATH
\ No newline at end of file
diff --git a/wolnelektury.wsgi b/wolnelektury.wsgi
new file mode 100644 (file)
index 0000000..adeb8aa
--- /dev/null
@@ -0,0 +1,16 @@
+import sys
+import os
+from os import path
+
+# Add project directories to PYTHONPATH
+PROJECT_DIR = path.abspath(path.dirname(__file__))
+PROJECT_MODULE_DIRS = [PROJECT_DIR + '/lib', PROJECT_DIR + '/apps', PROJECT_DIR + '/wolnelektury']
+
+sys.path = PROJECT_MODULE_DIRS + sys.path
+
+
+# Run Django
+from django.core.handlers.wsgi import WSGIHandler
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+application = WSGIHandler()
index 04b5fd5..c5b8d67 100644 (file)
@@ -80,7 +80,7 @@ MIDDLEWARE_CLASSES = [
 if DEBUG:
     MIDDLEWARE_CLASSES.append('middleware.ProfileMiddleware')
 
-ROOT_URLCONF = 'wolnelektury.urls'
+ROOT_URLCONF = 'urls'
 
 TEMPLATE_DIRS = (
     PROJECT_DIR + '/templates/'