Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5949 closed (wontfix)

Add RequestContext in middlewares or in templates

Reported by: xin@… 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 Malcolm Tredinnick, 17 years ago

Resolution: wontfix
Status: newclosed

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 by Chris Beaven, 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 eikke@…, 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/

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