Why am I getting the error: "Error: Render_to_response not defined"; Django
<p>I'm learning Django, and I found a very basic example online on how to display tables using templates. I followed the code exactly, but for some reason I get the error:</p>

<pre><code>Error: Render_to_response not defined
</code></pre>

<p>Here is my views.py:</p>

<pre><code>from django.shortcuts import render

def display(request):
    return render_to_response('template.tmpl', {'obj':models.Book.objects.all()})
</code></pre>

<p>Here is my urls.py:</p>

<pre><code>from django.conf.urls import url
from . import views

urlpatterns = [
    # /table/
    url(r'^$', views.display, name='display'),
]
</code></pre>

<p>Here is my template.tmpl:</p>

<pre><code>&lt;table&gt;
&lt;tr&gt;
  &lt;th&gt;author&lt;/th&gt;
  &lt;th&gt;title&lt;/th&gt;
  &lt;th&gt;publication year&lt;/th&gt;
&lt;/tr&gt;
{% for b in obj %}
&lt;tr&gt;
  &lt;td&gt;{{ b.author }}&lt;/td&gt;
  &lt;td&gt;{{ b.title }}&lt;/td&gt;
  &lt;td&gt;{{ b.publication_year }}&lt;/td&gt;
&lt;/tr&gt;
{% endfor %}
&lt;/table&gt;
</code></pre>

<p>Here is my models.py:</p>

<pre><code>from django.db import models

class Book(models.Model):
    author = models.CharField(max_length = 20)
    title = models.CharField(max_length = 40)
    publication_year = models.IntegerField()
</code></pre>

<p>I've looked online for some help with this error, but all the problems seem to be much more complicated than the one I'm facing. Is there something I'm missing?</p>

<p>You are importing <code>render</code> but using <code>render_to_response</code></p>

<p>Replace <code>render_to_response</code></p>

<pre><code>from django.shortcuts import render

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

python django