Use local.py if we don't have a host settings file
authorDiane Trout <diane@ghic.org>
Fri, 21 Oct 2016 22:08:15 +0000 (15:08 -0700)
committerDiane Trout <diane@ghic.org>
Fri, 21 Oct 2016 22:08:15 +0000 (15:08 -0700)
manage.py

index 74a06d716094b51f77a5845a44d9dc9b248d8b4d..81030032f4bc7fceaa6d5438d70bc9ad6fc15682 100755 (executable)
--- a/manage.py
+++ b/manage.py
@@ -4,9 +4,15 @@ import sys
 import socket
 
 if __name__ == "__main__":
+    hostname = socket.gethostname()
+    host_settings = os.path.join('htsworkflow/settings', hostname + '.py')
+    if os.path.exists(host_settings):
+        module = hostname
+    else:
+        module = 'local'
     os.environ.setdefault(
         "DJANGO_SETTINGS_MODULE",
-        "htsworkflow.settings.{}".format(socket.gethostname()))
+        "htsworkflow.settings.{}".format(module))
 
     from django.core.management import execute_from_command_line