title: Django NameError:  name 'models' is not defined
body: <p>I have a small application that I wrote in python. Did some research on some web frameworks and decided to use django. I'm reading through the manual and going step by step to learn as much, however I'm stuck on the example given on page 19. When I type the command an I get and error.</p>
  
  <pre><code>import datetime
  from django.utils import timezone
  # ...
  class Poll(models.Model):
  # ...
      def was_published_recently(self):
          return self.pub_date &gt;= timezone.now() - datetime.timedelta(days=1)
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
  NameError: name 'models' is not defined
  </code></pre>
  
  <p>I googled "Django NameError:" and didn't find much.</p>
  
  <p>Thanks.</p>