[Mageia-sysadm] [620] - add support for multiple module_path ( as needed by transifex ), and

root at mageia.org root at mageia.org
Wed Dec 15 02:39:37 CET 2010


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:
--------------
    puppet/modules/apache/templates/django.wsgi

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
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20101215/86ce2126/attachment.html>


More information about the Mageia-sysadm mailing list