Commits

Gregory Petukhov  committed cae5c60

Add module parameter to system.setup_django fuction. You can configure the name of settings file with this parameter

  • Participants
  • Parent commits 86297fd

Comments (0)

Files changed (2)

File common/system.py

 import os
 import sys
 
-def setup_django(script_file, relpath=None):
+def setup_django(script_file, relpath=None, module='settings'):
     ROOT = os.path.dirname(os.path.realpath(script_file))
     if relpath:
         ROOT = os.path.join(ROOT, relpath)
     os.chdir(ROOT)
     sys.path.append(ROOT)
-    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+    os.environ['DJANGO_SETTINGS_MODULE'] = module
 
     from django.conf import settings
 
 setup(
     name = 'django-common',
     description = 'A number of useful django shortcuts and helpers',
-    version = '0.1.47',
+    version = '0.1.48',
     author = 'Grigoriy Petukhov',
     author_email = 'lorien@lorien.name',
     url = 'http://bitbucket.org/lorien/django-common/',