Distutils installation script.
[redakcja.git] / platforma / config / platforma.wsgi.template
diff --git a/platforma/config/platforma.wsgi.template b/platforma/config/platforma.wsgi.template
new file mode 100644 (file)
index 0000000..3528fe8
--- /dev/null
@@ -0,0 +1,24 @@
+#!%(python)s
+import site
+site.addsitedir('%(path)s/lib/python2.5/site-packages')
+
+import os
+from os.path import abspath, dirname, join
+import sys
+
+# Redirect sys.stdout to sys.stderr for bad libraries like geopy that use
+# print statements for optional import exceptions.
+sys.stdout = sys.stderr
+
+# Add apps and lib directories to PYTHONPATH
+sys.path = [
+       '%(path)s/releases/current',
+       '%(path)s/releases/current/apps',
+       '%(path)s/releases/current/lib',
+] + sys.path
+
+# Run Django
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+
+from django.core.handlers.wsgi import WSGIHandler
+application = WSGIHandler()