[Answered ]-Django: decorator for catching response context from classic views

2👍

This isn’t possible. render_to_response will render the template with the context and return a completed HttpResponse object. The HttpResponse object would be available in your view decorator but the context data is already rendered into the response.

You’ll need to think of another approach. A custom middleware may be an option, take a look at process_template_response.

👤dgel

Leave a comment