-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmanage.py
More file actions
executable file
·26 lines (21 loc) · 905 Bytes
/
manage.py
File metadata and controls
executable file
·26 lines (21 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
from django.core.management import execute_from_command_line
COSINNUS_PORTAL_ARG = '--cosinnus-portal'
portal = None
# collect the portal arg, if given. this arg is used to redirect the used settings
# file to a portal-specific one
args = list(sys.argv)
if COSINNUS_PORTAL_ARG in args:
index = args.index(COSINNUS_PORTAL_ARG)
try:
portal = args[index+1]
except IndexError:
raise Exception('You must supply the name of a cosinnus portal when ' + \
'using the %s flag!' % COSINNUS_PORTAL_ARG)
args = args[:index] + args[index+2:]
settings_path = ('devops.config_%s' % portal) if portal else 'devops.settings'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', settings_path)
execute_from_command_line(args)