Just now you can store response object for a while and don't return it immediately. When set needed headers
response = render_to_response("foobar.html") response["Last-Modified"] = "some value" return response On Sat, Jan 24, 2009 at 8:24 PM, Viktor Nagy <viktor.n...@gmail.com> wrote: > Hi, > > I would like to provide proper Last-Modified headers, but in general my > code uses the render_to_response shortcut. As far as I understand the code, > even though I can add a **kwargs argument to render_to_response, it won't > get added to my response object. > > Is there an easy way to still achieve what I would like to without touching > the core code? Is there any chance that a patch that adds this funcionality > would be accepted? > > My implementation would be to extend the render_to_response code, so that > before returning the HttpResponse object, we get over an optionally passed > kwargs['headers'] dictionary, and add all of its elements to the > HttpResponse object. > > How would you achieve this? > > V > -- > Viktor Nagy - http://viktornagy.com > PhD student > Toulouse School of Economics > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---