2013-11-13 05:38:54 +01:00
|
|
|
|
2016-06-04 16:52:18 +02:00
|
|
|
from typing import Any
|
2013-11-13 05:38:54 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
2017-10-26 11:35:57 +02:00
|
|
|
def handle(self, *args: Any, **options: Any) -> None:
|
2013-11-13 05:38:54 +01:00
|
|
|
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)
|