manage.py 553 Bytes
Newer Older
Patrick's avatar
Patrick committed
1 2 3 4
#!/usr/bin/env python
import os
import sys

5

Patrick's avatar
Patrick committed
6
if __name__ == "__main__":
7 8 9 10 11 12 13 14

    os_environ = "DJANGO_SETTINGS_MODULE"
    project = os.path.split(os.path.abspath(os.path.dirname(__file__)))[-1]
    django_settings = "%s.common_settings" % project
    os.environ.setdefault(os_environ, django_settings)
    if os.environ.get(os_environ) != django_settings:
        os.environ.pop(os_environ)
        os.environ.setdefault(os_environ, django_settings)
Patrick's avatar
Patrick committed
15 16 17

    from django.core.management import execute_from_command_line

18
    execute_from_command_line(sys.argv)