forked from dimagi/commcare-hq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
executable file
·25 lines (19 loc) · 865 Bytes
/
manage.py
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
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from django.core.management import execute_manager
import sys, os
filedir = os.path.dirname(__file__)
submodules_list = os.listdir(os.path.join(filedir, 'submodules'))
for d in submodules_list:
if d == "__init__.py" or d == '.' or d == '..':
continue
sys.path.insert(1, os.path.join(filedir, 'submodules', d))
sys.path.append(os.path.join(filedir,'submodules'))
if __name__ == "__main__":
# proxy for whether we're running gunicorn with -k gevent
if "gevent" in sys.argv:
from restkit.session import set_session; set_session("gevent")
from gevent.monkey import patch_all; patch_all()
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)