summaryrefslogtreecommitdiffstats
path: root/manage.py
diff options
context:
space:
mode:
authorJérôme Schneider <jschneider@entrouvert.com>2014-10-16 14:25:18 (GMT)
committerJérôme Schneider <jschneider@entrouvert.com>2014-10-23 08:23:59 (GMT)
commitcee7c0d27b3b670064a079423923f572b66f3a76 (patch)
treec8e5b8663493d240e2baa00ea6ef405b6a490e7e /manage.py
parentad989bebf03c431432bd8d70f7657fa17a92ccbb (diff)
downloadhobo-cee7c0d27b3b670064a079423923f572b66f3a76.zip
hobo-cee7c0d27b3b670064a079423923f572b66f3a76.tar.gz
hobo-cee7c0d27b3b670064a079423923f572b66f3a76.tar.bz2
settings: use new method to manage settings
Closes #5703
Diffstat (limited to 'manage.py')
-rwxr-xr-xmanage.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/manage.py b/manage.py
index c84d3a0..b103685 100755
--- a/manage.py
+++ b/manage.py
@@ -3,8 +3,32 @@ import os
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hobo.settings")
+ multitenant = False
+ config_file = False
+
+ argv = sys.argv[1:]
+ for arg in list(argv):
+ if arg.startswith('--'):
+ if arg.startswith('--config='):
+ config_file = arg.split('=')[1]
+ argv.pop(0)
+ elif arg == '--multitenant':
+ multitenant = True
+ argv.pop(0)
+ else:
+ print >>sys.stderr, 'ERR: Unsupported flag', arg
+ sys.exit(1)
+ else:
+ break
+
+ if config_file:
+ os.environ['DJANGO_CONFIG_FILE'] = config_file
+
+ if multitenant:
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hobo.tenant_settings")
+ else:
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hobo.settings")
from django.core.management import execute_from_command_line
- execute_from_command_line(sys.argv)
+ execute_from_command_line(sys.argv[:1] + argv)