another render_to_response wrapper

1
2
3
4
5
6
7
8
9
def render_response(*args, **kwargs):
        response = kwargs.pop('response', None)
        if response == None:
            from django.shortcuts import render_to_response
            return render_to_response(*args, **kwargs)
        else:
            from django.template import loader
            response.content = loader.render_to_string(*args, **kwargs)
            return response

More like this

  1. render_to_response wrapper by Magus 6 years, 2 months ago
  2. Auto rendering decorator with options by Batiste 5 years, 3 months ago
  3. render_with decorator by tobias 4 years, 8 months ago
  4. Caching XHTML render_to_response by smoonen 4 years, 10 months ago
  5. simplified render_to_response with RequestContext by jasongreen 3 years, 4 months ago

Comments

(Forgotten your password?)