diff options
Diffstat (limited to 'ca')
-rwxr-xr-x | ca/irbe_cli | 22 | ||||
-rwxr-xr-x | ca/rpki-manage | 13 | ||||
-rw-r--r-- | ca/rpki.wsgi | 3 |
3 files changed, 4 insertions, 34 deletions
diff --git a/ca/irbe_cli b/ca/irbe_cli index d425095b..2edde024 100755 --- a/ca/irbe_cli +++ b/ca/irbe_cli @@ -321,27 +321,7 @@ while argv: argv = q_pdu.client_getopt(argv[1:]) q_msg.append(q_pdu) -if True: - os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings") - -else: - import django - from django.conf import settings - settings.configure( - DATABASES = { "default" : { - "ENGINE" : "django.db.backends.mysql", - "NAME" : cfg.get("sql-database", section = "irdbd"), - "USER" : cfg.get("sql-username", section = "irdbd"), - "PASSWORD" : cfg.get("sql-password", section = "irdbd"), - "HOST" : "", - "PORT" : "", - "OPTIONS" : { "init_command": "SET storage_engine=INNODB" }}}, - INSTALLED_APPS = ("rpki.irdb",), - MIDDLEWARE_CLASSES = (), - ) - if django.VERSION >= (1, 7): - from django.apps import apps - apps.populate(settings.INSTALLED_APPS) +os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings.irdb") import rpki.irdb diff --git a/ca/rpki-manage b/ca/rpki-manage index db1e9ce3..b478549e 100755 --- a/ca/rpki-manage +++ b/ca/rpki-manage @@ -1,7 +1,6 @@ #!/usr/bin/env python import os -from django.core.management import execute_from_command_line # django-admin seems to have problems creating the superuser account when # $LANG is unset or is set to something totally incompatible with UTF-8. @@ -9,16 +8,8 @@ from django.core.management import execute_from_command_line if os.environ.get("LANG") in (None, "", "C"): os.environ["LANG"] = "en_US.UTF-8" -# Where to find the Django settings module - -os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings") +os.environ.setdefault(DJANGO_SETTINGS_MODULE = "rpki.django_settings.gui") -# We don't know whether we're being used to configure the GUI or not -# (well, not without examining the specific command, which we'd like -# to avoid). Default to enabling the GUI so that such commands will -# work, but allow the user to override via the environment variable. - -if not os.environ.get("RPKI_GUI_ENABLE"): - os.environ["RPKI_GUI_ENABLE"] = "yes" +from django.core.management import execute_from_command_line execute_from_command_line() diff --git a/ca/rpki.wsgi b/ca/rpki.wsgi index 7fa85d73..8c3481ef 100644 --- a/ca/rpki.wsgi +++ b/ca/rpki.wsgi @@ -21,8 +21,7 @@ import sys import os import rpki.autoconf -os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings", - RPKI_GUI_ENABLE = "yes") +os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings.gui") # Needed for local_settings.py sys.path.insert(1, rpki.autoconf.sysconfdir + '/rpki') |