Andres Gallardo Andres Gallardo - 5 months ago 30x
Python Question

Django tables 2: error django.template.context_processors.request

I installed the module tables 2 and i have the next problem:

Exception Value: Tag {% querystring %} requires
django.template.context_processors.request to be in the template
configuration in settings.TEMPLATES[]OPTIONS.context_processors) in
order for the included template tags to function correctly.

My code is:

'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR + '/llamadas/plantillas')],
'APP_DIRS': True,
'context_processors': [

def home(request):
if request.user.is_authenticated():
llamadas = CallEntry.objects.all()
return render_to_response('inicio.html', {'llamadas': llamadas})
return HttpResponseRedirect('/accounts/login/')


{% load render_table from django_tables2 %}
<!doctype html>
<link rel="stylesheet" href="{{ STATIC_URL }}django_tables2/themes/paleblue/css/screen.css" />
{% render_table llamadas %}

Any suggestions?

Thanks !


The render_to_response shortcut is not recommended any more.

Use the render shortcut instead, so that the context processors are used.

return render(request, 'inicio.html', {'llamadas': llamadas})