Revision
620
Author
misc
Date
2010-12-15 02:39:37 +0100 (Wed, 15 Dec 2010)

Log Message

- add support for multiple module_path ( as needed by transifex ), and
  to not prefix the settings module ( in case of, but not needed now )

Modified Paths

Modified: puppet/modules/apache/templates/django.wsgi
===================================================================
--- puppet/modules/apache/templates/django.wsgi	2010-12-15 01:39:36 UTC (rev 619)
+++ puppet/modules/apache/templates/django.wsgi	2010-12-15 01:39:37 UTC (rev 620)
@@ -1,7 +1,16 @@
 #!/usr/bin/python
 import os, sys
-sys.path.append('<%= module_path  %>')
+<%- for m in module_path -%>
+path = '<%= m %>'
+if path not in sys.path:
+    sys.path.append(path)
+<%- end -%>
+
+<%- if django_module -%>
 os.environ['DJANGO_SETTINGS_MODULE'] = '<%= django_module %>.settings'
+<%- else -%>
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+<%- end -%>
 
 import django.core.handlers.wsgi