forked from mozilla/kitsune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
executable file
·32 lines (27 loc) · 1018 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
#!/usr/bin/env python
import os
import sys
import traceback
# Now we can import from third-party libraries.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings')
os.environ.setdefault('CELERY_CONFIG_MODULE', 'kitsune.settings')
# MONKEYPATCH! WOO HOO!
# Need this so we patch before running Django-specific commands which
# then result in a circular import.
try:
from kitsune.sumo.monkeypatch import patch # noqa
patch()
except ImportError:
print 'OH NOES! There was an import error:'
print ''
print ''.join(traceback.format_exception(*sys.exc_info()))
if 'VIRTUAL_ENV' in os.environ:
print 'Have you installed requirements? Are they up-to-date?'
else:
print 'Have you activated your virtual environment?'
sys.exit(1)
# Import for side-effect: configures our logging handlers.
from kitsune import log_settings # noqa
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)