I have read Django - CSRF verification failed and several questions (and answers) related to django and POST method. One of the best-but-not-working-for-me answer is https://sta
You also can use
direct_to_template(request, 'library/search.html', result)
instead of
render_to_response('library/search.html', result, context_instance=RequestContext(request))
because direct_to_template
adds RequestContext
automatically. But note that direct_to_template
is going to be deprecated and django offers to use CBV TemplateView
instead.
RequestContext allows you to use context processors. And this is your mistake: {% csrf_token %}
outputed empty string and you got 403.