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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d4746049-eac2-4ad6-80b5-2b1886bc4498n%40googlegroups.com.

Reply via email to