mirror of
https://github.com/django-components/django-components.git
synced 2025-07-14 04:14:58 +00:00
25 lines
571 B
Python
25 lines
571 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", [])
|
|
|
|
@property
|
|
def TEMPLATE_CACHE_SIZE(self):
|
|
return self.settings.setdefault("template_cache_size", 128)
|
|
|
|
|
|
app_settings = AppSettings()
|
|
app_settings.__name__ = __name__
|
|
sys.modules[__name__] = app_settings
|