[Django]-Why am I getting the error: "Error: Render_to_response not defined"; Django

4👍

You are importing render but using render_to_response

Replace render_to_response

from django.shortcuts import render

def display(request):
    return render(request, 'template.tmpl', {'obj':models.Book.objects.all()})

Leave a comment