render_template shortcut

1
2
3
4
5
6
7
8
# Render with context processors shortcut
def render_template(request, template_path, extra_context = {}):
	from django.template import RequestContext
	from django.shortcuts import render_to_response

	c = RequestContext(request)
	c.update(extra_context)
	return render_to_response(template_path, context_instance=c)

More like this

  1. Render (with RequestContext) by alcides 3 years, 6 months ago
  2. render_to_response wrapper by Magus 4 years, 11 months ago
  3. render_to_response decorator by coleifer 1 year, 4 months ago
  4. Renderer decorator by GaretJax 4 years, 2 months ago
  5. render_to by asolovyov 3 years, 7 months ago

Comments

(Forgotten your password?)