forked from creativecommons/cc-legal-tools-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
executable file
·36 lines (29 loc) · 830 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
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
# Standard library
import logging
import os
import sys
LOG = logging.getLogger("management.commands")
def main():
if "DATABASE_URL" in os.environ:
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "cc_legal_tools.settings.deploy"
)
else:
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "cc_legal_tools.settings.local"
)
# Third-party
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
if __name__ == "__main__":
try:
main()
except SystemExit as e:
sys.exit(e.code)
except KeyboardInterrupt:
LOG.info("Halted via KeyboardInterrupt.")
sys.exit(130)
except Exception:
LOG.exception("Unhandled exception:")
sys.exit(1)