django-components/django_components/app_settings.py
2021-02-05 21:31:09 +01:00

21 lines
453 B
Python

import sys
from django.conf import settings
class AppSettings:
def __init__(self):
self.settings = getattr(settings, "COMPONENTS", {})
@property
def AUTODISCOVER(self):
return self.settings.setdefault("autodiscover", True)
@property
def LIBRARIES(self):
return self.settings.setdefault("libraries", [])
app_settings = AppSettings()
app_settings.__name__ = __name__
sys.modules[__name__] = app_settings