Skip to content
Newer
Older
100755 26 lines (20 sloc) 829 Bytes
8cbecbc @senko empty relocatable Django project
authored May 4, 2011
1 #!/usr/bin/env python
41c6d10 @senko update manage.py to django1.4, add wsgi.py
authored Apr 7, 2012
2 from os import environ, listdir
3 from os.path import join, dirname, abspath, exists
4 import sys
8cbecbc @senko empty relocatable Django project
authored May 4, 2011
5
6 if __name__ == "__main__":
41c6d10 @senko update manage.py to django1.4, add wsgi.py
authored Apr 6, 2012
7
8 # Try to discover project name and set the default settings module
9 # based on it. If discovery fails, DJANGO_SETTINGS_MODULE environment
10 # variable must be set.
11
12 root = dirname(abspath(__file__))
13 sys.path.append(root)
14 settings_module = None
15 for name in listdir(root):
16 full_name = join(root, name)
155fa1b @senko manage.py, settings/base.py tweaks
authored Apr 7, 2012
17 if exists(join(full_name, 'settings', '__init__.py')):
41c6d10 @senko update manage.py to django1.4, add wsgi.py
authored Apr 6, 2012
18 settings_module = name + '.settings'
19 break
20
21 if settings_module is not None:
22 environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
23
24 from django.core.management import execute_from_command_line
25 execute_from_command_line(sys.argv)
Something went wrong with that request. Please try again.