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
- render_to_response wrapper by Magus 6 years, 2 months ago
- Auto rendering decorator with options by Batiste 5 years, 3 months ago
- render_with decorator by tobias 4 years, 8 months ago
- Caching XHTML render_to_response by smoonen 4 years, 10 months ago
- simplified render_to_response with RequestContext by jasongreen 3 years, 4 months ago
Comments