forked from KSET/kset-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage.py
More file actions
executable file
·25 lines (20 loc) · 829 Bytes
/
manage.py
File metadata and controls
executable file
·25 lines (20 loc) · 829 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
#!/usr/bin/env python
from os import environ, listdir
from os.path import join, dirname, abspath, exists
import sys
if __name__ == "__main__":
# Try to discover project name and set the default settings module
# based on it. If discovery fails, DJANGO_SETTINGS_MODULE environment
# variable must be set.
root = dirname(abspath(__file__))
sys.path.append(root)
settings_module = None
for name in listdir(root):
full_name = join(root, name)
if exists(join(full_name, 'settings', '__init__.py')):
settings_module = name + '.settings'
break
if settings_module is not None:
environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)