On Monday, October 31, 2022 at 5:27:02 PM UTC+1 pe...@lincolnloop.com wrote:
> In my ideal scenario, the default is a hard-coded settings file for the > project (deprecating DJANGO_SETTINGS_MODULE env var) and we have > CONFIG_LOADERS defined in the settings that could do env, toml, etc. > Perhaps things like django.setup, > django.core.wsgi.get_wsgi_application, and > django.core.management.execute_from_command_line could accept the settings > module as an argument? django-admin could accept a --settings flag? > I doubt that will ever fly. There is no project so to say in Django. Currently literally everything depends on knowing a `DJANGO_SETTINGS_MODULE` from which everything else can follow (even the wsgi app…). So without a settings file how would you know that hard-coded path for it? Django has no concept of a project that you could import. You also cannot easily put `CONFIG_LOADERS` in a settings file like we currently have because then how are you going to evaluate that while also executing all the other module level stuff. And django-admin command all already support a `--settings` flag (as alternative to DJANGO_SETTINGS_MODULE ;)) Either way I doubt we will deprecating DJANGO_SETTINGS_MODULE any time soon. And I don't see it such of a problem with being there. Projects can set it (and startproject already does this) to a fixed value in manage.py & wsgi.py. For a project that installs a custom entrypoint script, you can also preset it to whatever you like. Please note that we are trying to load stuff from files & env vars in the first step, not throw out settings.py at the same time… Cheers, Florian -- 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/b0cc8e42-0781-4a69-b8a1-12cc6929c2f7n%40googlegroups.com.