Export to GitHub

django-xmlrpc - issue #4

Default template rendered for GET requests doesn't inherit context variables


Posted on Aug 3, 2008 by Helpful Kangaroo

Using Django current #7869, django_xmlrpc-0.1.tar.gz

I wanted to customize the error message page for GET requests, but didn't have available the context parameters added by context processors.

From Django manual: "If you’re using Django’s render_to_response() shortcut to populate a template with the contents of a dictionary, your template will be passed a Context instance by default (not a RequestContext). To use a RequestContext in your template rendering, pass an optional third argument to render_to_response(): a RequestContext instance..."

Cheers, Cristian.

Diff is:

Patch 34a35 > from django.template import RequestContext 75c76

< return render_to_response(settings.XMLRPC_GET_TEMPLATE)

> return render_to_response(settings.XMLRPC_GET_TEMPLATE, context_instance=RequestContext(request))

Comment #1

Posted on Aug 29, 2008 by Happy Elephant

This isn't an issue if you use the most recent version of the source in which that code has been deprecated.

Status: New

Labels:
Type-Defect Priority-Medium