2013-11-13 05:38:54 +01:00
|
|
|
from __future__ import absolute_import
|
2015-11-01 17:11:06 +01:00
|
|
|
from __future__ import print_function
|
2013-11-13 05:38:54 +01:00
|
|
|
|
|
|
|
from optparse import make_option
|
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from django.conf import settings
|
|
|
|
import sys
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
2015-08-21 11:56:54 +02:00
|
|
|
help = """Checks your Zulip Voyager Django configuration for issues."""
|
2013-11-13 05:38:54 +01:00
|
|
|
|
|
|
|
option_list = BaseCommand.option_list + ()
|
|
|
|
def handle(self, **options):
|
|
|
|
for (setting_name, default) in settings.REQUIRED_SETTINGS:
|
|
|
|
try:
|
|
|
|
if settings.__getattr__(setting_name) != default:
|
|
|
|
continue
|
|
|
|
except AttributeError:
|
|
|
|
pass
|
|
|
|
|
2015-11-01 17:11:06 +01:00
|
|
|
print("Error: You must set %s in /etc/zulip/settings.py." % (setting_name,))
|
2013-11-13 05:38:54 +01:00
|
|
|
sys.exit(1)
|