#25839: RequestContext does not apply context processors [regression] -------------------------------------+------------------------------------- Reporter: direx | Owner: nobody Type: Bug | Status: new Component: Documentation | Version: 1.8 Severity: Normal | Resolution: Keywords: RequestContext, | Triage Stage: Accepted regression | Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by carljm):
* component: Template system => Documentation Comment: That's a good point; I looked through the `RequestContext` docs but didn't notice that dictionary-style access was documented higher up in the `Context` docs. I think that does make it a backwards-incompatible change to a public API that should have been documented in the release notes. However, I still don't think it's a valuable enough usage to fix at this point. If we had run across this case while building multiple-template- engines, I think we'd have documented it as a minor backwards- incompatibility, not attempted to accommodate it -- the usage just doesn't belong in a multiple-template-engines world. I'd be willing to look at a proposed patch, but I think a patch will need to introduce too much complexity. Specifically, a patch to reintroduce the old behavior would need to introduce a scheme for lazy-loading of the "default" context processors (that is, the ones configured for the "default" DTL instance -- which doesn't exist if there's more than one DTL instance configured) that takes place only if someone tries to dictionary- access a RequestContext that hasn't been bound to a template. This would be an entirely new code path that exists only to support this usage. I don't think that added complexity is justified by the limited-to- nonexistent need for this usage (note that the docs don't ever recommend it for any real purpose, just for "playing around" to understand Context objects). So I think this ticket should be fixed the same way we'd have fixed it if we'd noticed it before the release of 1.8: by making a note of the issue in the backwards-incompatible changes section of the 1.8 release notes, and perhaps also clarifying the RequestContext docs to note that values from context processors are only available in a RequestContext once it has been bound to a template (which Django does automatically when you render a template using a RequestContext). -- Ticket URL: <https://code.djangoproject.com/ticket/25839#comment:7> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.119d57072335d00d8ff6a27997a62e1e%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.