Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5949 closed (wontfix)

Add RequestContext in middlewares or in templates

Reported by: xin@… Owned by: nobody
Component: Core (Other) Version: master
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: UI/UX:



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.


Change History (3)

comment:1 Changed 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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.

comment:2 Changed 8 years ago by SmileyChris

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 Changed 8 years ago by eikke@…

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:

Note: See TracTickets for help on using tickets.
Back to Top