TT#121955 import conf from AppConfig.ready()

AppConf classes depend on being imported during startup of the Django process.

Change-Id: I16f6860a47467fd3ed138df46df81497ddf00f77
pull/5/head
Victor Seva 3 years ago
parent c06ee00456
commit 5ca6d5ddb9

@ -19,5 +19,7 @@ class ReleaseConfig(AppConfig):
name = "build" name = "build"
def ready(self): def ready(self):
from .conf import settings # noqa
# Implicitly connect a signal handlers decorated with @receiver. # Implicitly connect a signal handlers decorated with @receiver.
from . import signals # noqa from . import signals # noqa

@ -17,3 +17,6 @@ from django.apps import AppConfig
class HotfixConfig(AppConfig): class HotfixConfig(AppConfig):
name = "hotfix" name = "hotfix"
def ready(self):
from .conf import settings # noqa

@ -17,3 +17,6 @@ from django.apps import AppConfig
class PanelConfig(AppConfig): class PanelConfig(AppConfig):
name = "panel" name = "panel"
def ready(self):
from .conf import settings # noqa

@ -1,25 +0,0 @@
# Copyright (C) 2020 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This is needed due to:
#
# AppConf classes depend on being imported during startup of the Django
# process. Even though there are multiple modules loaded automatically, only
# the models modules (usually the models.py file of your app) are guaranteed
# to be loaded at startup. Therefore its recommended to put your AppConf
# subclass(es) there, too.
#
# https://django-appconf.readthedocs.io/en/latest/
from .conf import settings # noqa

@ -17,3 +17,6 @@ from django.apps import AppConfig
class ReleaseChangedConfig(AppConfig): class ReleaseChangedConfig(AppConfig):
name = "release_changed" name = "release_changed"
def ready(self):
from .conf import settings # noqa

@ -17,3 +17,6 @@ from django.apps import AppConfig
class ReleaseDashboardConfig(AppConfig): class ReleaseDashboardConfig(AppConfig):
name = "release_dashboard" name = "release_dashboard"
def ready(self):
from .conf import settings # noqa

Loading…
Cancel
Save