Hello Christian,

> On 5 Jan 2020, at 14:30, Christian González <christian.gonza...@nerdocs.at> 
> wrote:
> 
> And to be honest - does this really make sense to urge people - writing more 
> code to satisfy the framework?
> What I mean is: Why don't you drop that recommendation - when noone is using 
> it - more than one AppConfigs still *are* possible, even when there is a 
> default
> 

The original intent was to make configuration explicit by having settings.py 
reference directly the target AppConfig class.

- When you write MIDDLEWARE = ["polls"], do you expect Django to enable 
"polls.middleware.PollsMiddleware"?
- When you write INSTALLED_APPS = ["polls"], do you expect Django to enable 
"polls.apps.PollsAppConfig"?

Many readers of this mailing list will answer "no" and "yes" respectively. I 
think the answer to both should be "no", according to Django's design 
philosophy 
<https://docs.djangoproject.com/en/3.0/misc/design-philosophies/#explicit-is-better-than-implicit>.
 (If you're about to argue that an application can provide more than one 
middleware — I'm aware of this and I know you understood my point anyway.)

Even though the extra level of indirection via default_app_config exists only 
for backwards-compatibility, everyone seems to be happy with it. Perhaps it's 
time to be pragmatic and admit I made the wrong call.

If we're reversing course, giving up on explicitness and going for magic, we 
could embrace that decision fully: import the "apps" submodule inside each 
application; if it exists and it defines exactly one AppConfig subclass, use 
that as the config for this app. Then app authors can stop littering their 
__init__.py files with default_app_config.

Best regards,

-- 
Aymeric.

-- 
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/18C7BEF5-7FF3-4324-91C0-6C4C8AC3174D%40polytechnique.org.

Reply via email to