mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Make the config object lazy for old Djangos.
This should prevent import time side effects from instantiating the config object directly there.
This commit is contained in:
parent
1b3ffbc049
commit
1f958dc443
1 changed files with 3 additions and 1 deletions
|
|
@ -1,10 +1,12 @@
|
|||
from .base import Config
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
|
||||
__version__ = '1.0a1'
|
||||
|
||||
|
||||
try:
|
||||
from django.apps import AppConfig # noqa
|
||||
except ImportError:
|
||||
config = Config()
|
||||
config = SimpleLazyObject(Config)
|
||||
else:
|
||||
default_app_config = 'constance.apps.ConstanceConfig'
|
||||
|
|
|
|||
Loading…
Reference in a new issue