kitsune/manage.py

32 строки
957 B
Python
Исходник Обычный вид История

2010-02-04 02:09:30 +03:00
#!/usr/bin/env python
import os
2010-08-12 04:15:29 +04:00
import sys
import traceback
2010-08-12 04:15:29 +04:00
# Now we can import from third-party libraries.
2017-11-15 10:33:39 +03:00
os.environ.setdefault('DJANGO_SETTINGS_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:
2020-01-16 21:44:50 +03:00
print('OH NOES! There was an import error:')
print('')
print(''.join(traceback.format_exception(*sys.exc_info())))
if 'VIRTUAL_ENV' in os.environ:
2020-01-16 21:44:50 +03:00
print('Have you installed requirements? Are they up-to-date?')
else:
2020-01-16 21:44:50 +03:00
print('Have you activated your virtual environment?')
sys.exit(1)
# Import for side-effect: configures our logging handlers.
2015-04-10 05:42:59 +03:00
from kitsune import log_settings # noqa
2010-02-04 02:09:30 +03:00
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)