title: Django:name 'Post' is not defined in InteractiveConsole
body: <p>I am very new to Django, and was trying to develop a blog based on it.</p>
  
  <p>After the commands of <code>python manage.py makemigrations</code>  and <code>python manage.py migrate</code> worked well, I got into the InteractiveConsole to execute <code>Post.objects.all()</code> and got a NameError.</p>
  
  <pre><code>&gt;&gt;&gt; Post.objects.all()
  Traceback (most recent call last):
  File "&lt;console&gt;", line 1, in &lt;module&gt;
  NameError: name 'Post' is not defined
  </code></pre>
  
  <p>Besides, when running localhost:8000, Server gave another NameError.</p>
  
  <pre><code>NameError at /
  name 'Post' is not defined
  Request Method: GET
  Request URL:    http://localhost:8000/
  Django Version: 2.0
  Exception Type: NameError
  Exception Value:    
  name 'Post' is not defined
  Exception Location: D:\experiment\blogproject\blog\views.py in index, line 6
  Python Executable:  d:\experiment\blogproject_env\Scripts\python.exe
  Python Version: 3.6.3
  Python Path:    
  ['D:\\experiment\\blogproject',
  'd:\\experiment\\blogproject_env\\Scripts\\python36.zip',
  'd:\\experiment\\blogproject_env\\DLLs',
  'd:\\experiment\\blogproject_env\\lib',
  'd:\\experiment\\blogproject_env\\Scripts',
  'd:\\professional soft\\python3.6.3\\Lib',
  'd:\\professional soft\\python3.6.3\\DLLs',
  'd:\\experiment\\blogproject_env',
  'd:\\experiment\\blogproject_env\\lib\\site-packages']
  Server time:    星期五, 22 十二月 2017 16:08:10 +0800
  </code></pre>
  
  <p>and the following was my views.py.</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  
  
  def index(request):
      post_list = Post.objects.all().order_by('-created_time')
      return render(request, 'blog/index.html', context={'post_list': post_list})
  </code></pre>
  
  <p>In case, there is the Post code in models.py.</p>
  
  <p>class Post(models.Model):
      title = models.CharField(max_length=70)</p>
  
  <pre><code>body = models.TextField()
  
  created_time = models.DateTimeField()
  modified_time = models.DateTimeField()
  
  excerpt = models.CharField(max_length=200, blank=True)
  
  category = models.ForeignKey(Category, on_delete=models.CASCADE)
  tags = models.ManyToManyField(Tag, blank=True)
  
  author = models.ForeignKey(User, on_delete=models.CASCADE)
  
  def __str__(self):
      return self.title
  </code></pre>
  
  <p>Thank u so much!</p>