Hi Curtis, On 01/08/2016 04:31 AM, Curtis Maloney wrote: > In general, I love it.
Great! > It's MUCH simpler for people to write and comprehend... requires no > classes [but IMHO the callable class is "cleaner"] and allows for > configurable middlewares easily... > > I do wonder, though... how the anti-import-strings factions will > react... I'm sure it can, at least, support direct callables being in > the MIDDLEWARE list, not just strings? Well, I guess I'm part of that faction, and I wrote the proposal :-) The settings file is one place where import-strings are pretty much unavoidable in Django, because you can't safely import anything into your settings model that indirectly imports models, or certain other parts of Django that require settings to be loaded. I don't _like_ this, but it's the reality, at least until we get rid of settings as a global singleton (if that ever happens). We could support directly including middleware factories instead of just import strings in your MIDDLEWARE setting, but I don't think that's a good idea, as encouraging people to import stuff from their project into their settings file is almost certain to end with it blowing up in their face at some point. Carl -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/568FE95E.8060401%40oddbird.net. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
