Models and URLSs (kind of) are namespaced by the
app_label.
I am making a Django CSS app to open source, and it requires settings. For now I am just going to copy DRF and use a dict to avoid collisions.
What if in settings.py we could do something like this (where one has an app with an app_label of 'foo'):
FOO_SETTINGS = {
'POGO_STICKS': 5,
'MORE_SETTINGS': [1,2,3],
}
or (what I think is better) use class based approach:
# Here DjangoAppSettings is just a subclass of maybe a dataclass, to use in isintance tests to find the settings (like how TestCase's are found).
FooSettings(DjangoAppSettings):
POGO_STICKS = 5
MORE_SETTINGS = [1,2,3]
Then in the app that consumes the settings, maybe do something like this (or something different):
from django.conf import settings
apps.get_app_config('foo').settings
And it would return FooSettings
I have not given it much thought, but its just concept I am proposing, not the exact implementation.