forked from kennknowles/core-hq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
executable file
·29 lines (23 loc) · 1.11 KB
/
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
26
27
28
29
#!/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'))
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
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()
execute_manager(settings)