#5949 closed (wontfix)
Add RequestContext in middlewares or in templates
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | request context templates middleware | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hello,
More times, when anyone use a extern django application, if this do not add a request context in the render_to_response, the parent templates can not print his data that a middlweare put in HttpRequest.
For this, I think is a good idea set the adding of request context in the context of templates, from the settings, o directly from the templates.
Templatetags and filters do not permit access to request data for use his values.
Thanks
Change History (3)
comment:1 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 17 years ago
You don't even need to define your own, we have django.views.generic.direct_to_template
if you want a shortcut which accepts request
and uses a RequestContext
.
comment:3 by , 17 years ago
FYI: I'm using a custom function which mimics render_to_response's behaviour, and is backward API-compatible, ie, if you don't use the "new" feature (old method signature), there's no overhead. You can find more info here: http://eikke.com/2007/12/26/two-django-snippets/
We've already decided a number of times in the past that RequestContext will not be the default because you don't always want or need the overhead of the context processors.
You are quite free to define your own render_to_response() method that behaves as you like, though. It's very simple method, after all.