title: ProgrammingError (Error during template rendering)
body: <blockquote>
    <p>I am getting this Exception in my browser, I have seen upto 20 posts related to this error but I could not have found any solution.I am using Postgre database (pgAdmin 4). I am new to Django, Please help me, Thanks in advance.</p>
    
    <p>I have made a project from djangogirls tutorial <a href="http://tutorial.djangogirls.org/en/#django-girls-tutorial" rel="nofollow">http://tutorial.djangogirls.org/en/#django-girls-tutorial</a>. Then I changed my database to postgre and prject was running as expected. then I made a copy of this project and stored somewhere in my PC. Then I made some changes to my original project with same database settings. </p>
    
    <p>when I run my copy of previous project I found this Error :- </p>
    
    <p>projectname/urls.py</p>
  </blockquote>
  
  <pre><code>   urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'', include('blog.urls')),
  ]
  </code></pre>
  
  <blockquote>
    <p>My views.py</p>
  </blockquote>
  
  <pre><code>def blog_list(request):
  posts = Blog.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
  return render(request, 'blog/blog_list.html', {'posts': posts})
  </code></pre>
  
  <blockquote>
    <p>blog_list.html</p>
  </blockquote>
  
  <pre><code>{% for post in posts %}
      &lt;div class="post"&gt;
          &lt;div class="date"&gt;
              {{ post.published_date }}
          &lt;/div&gt;
          &lt;h1&gt;&lt;a href="{% url 'blog_detail' pk=post.pk %}"&gt;{{ post.title }}&lt;/a&gt;&lt;/h1&gt;
          &lt;p&gt;{{ post.short_description|linebreaksbr }}&lt;/p&gt;
      &lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <blockquote>
    <p>my models.py</p>
  </blockquote>
  
  <pre><code>    class Blog(models.Model):
      author = models.ForeignKey('auth.User')
      title = models.CharField(max_length=200)
      sub_title = models.CharField(max_length=100, null = True)
      short_description = models.CharField(max_length=100, null = True)
      long_description = models.TextField(null = True)
      #text = models.TextField()
      published_date = models.DateTimeField(blank=True, null=True)
      created_date = models.DateTimeField(auto_now_add=True)
      last_updated = models.DateTimeField(auto_now=True)
  
      def publish(self):
          self.published_date = timezone.now()
          self.save()
  
      def __str__(self):
          return self.title
  
  class DeletedPost(models.Model):
      post_title = models.CharField(max_length=200, null=True)
      deleted = models.DateTimeField(default = timezone.now)
  </code></pre>
  
  <blockquote>
    <p>my appname/urls.py</p>
  </blockquote>
  
  <pre><code>   urlpatterns = [
      url(r'^$', views.blog_list, name='blog_list'),
      url(r'^blog/(?P&lt;pk&gt;\d+)/$', views.blog_detail, name='blog_detail'),
      url(r'^blog/new/$', views.blog_new, name='blog_new'),
      url(r'^blog/(?P&lt;pk&gt;\d+)/edit/$', views.blog_edit, name='blog_edit'),
      url(r'^blog/(?P&lt;pk&gt;\d+)/delete/$', views.post_delete, name='post_delete'),
  ]
  </code></pre>
  
  <blockquote>
    <p>Error in Browser :</p>
  </blockquote>
  
  <p>Traceback:</p>
  
  <pre><code>Request Method: GET
  Request URL: http://127.0.0.1:8000/
  
  Django Version: 1.10
  Python Version: 3.4.3
  Installed Applications:
  ['django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'blog']
  Installed Middleware:
  ['django.middleware.security.SecurityMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware']
  
  
  Template error:
  In template D:\mysite\blog\templates\blog\blog_list.html, error at line 4
     relation "blog_blog" does not exist
  LINE 1: ..."."created_date", "blog_blog"."last_updated" FROM "blog_blog...
                                                               ^
     1 : {% extends 'blog/base.html' %}
     2 : 
     3 : {% block content %}
     4 :      {% for post in posts %} 
     5 :         &lt;div class="post"&gt;
     6 :             &lt;div class="date"&gt;
     7 :                 {{ post.published_date }}
     8 :             &lt;/div&gt;
     9 :             &lt;h1&gt;&lt;a href="{% url 'blog_detail' pk=post.pk %}"&gt;{{ post.title }}&lt;/a&gt;&lt;/h1&gt;
     10 :             &lt;p&gt;{{ post.short_description|linebreaksbr }}&lt;/p&gt;
     11 :         &lt;/div&gt;
     12 :     {% endfor %}
     13 : {% endblock %}
  
  Traceback:
  
  File "C:\Python34\lib\site-packages\django\db\backends\utils.py" in execute
    64.                 return self.cursor.execute(sql, params)
  
  The above exception (relation "blog_blog" does not exist
  LINE 1: ..."."created_date", "blog_blog"."last_updated" FROM "blog_blog...
                                                               ^
  ) was the direct cause of the following exception:
  
  File "C:\Python34\lib\site-packages\django\core\handlers\exception.py" in inner
    39.             response = get_response(request)
  
  File "C:\Python34\lib\site-packages\django\core\handlers\base.py" in _get_response
    187.                 response = self.process_exception_by_middleware(e, request)
  
  File "C:\Python34\lib\site-packages\django\core\handlers\base.py" in _get_response
    185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "D:\mysite\blog\views.py" in blog_list
    10.     return render(request, 'blog/blog_list.html', {'posts': posts})
  
  File "C:\Python34\lib\site-packages\django\shortcuts.py" in render
    30.     content = loader.render_to_string(template_name, context, request, using=using)
  
  File "C:\Python34\lib\site-packages\django\template\loader.py" in render_to_string
    68.     return template.render(context, request)
  
  File "C:\Python34\lib\site-packages\django\template\backends\django.py" in render
    66.             return self.template.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render
    208.                     return self._render(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in _render
    199.         return self.nodelist.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render
    994.                 bit = node.render_annotated(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render_annotated
    961.             return self.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\loader_tags.py" in render
    174.         return compiled_parent._render(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in _render
    199.         return self.nodelist.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render
    994.                 bit = node.render_annotated(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render_annotated
    961.             return self.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\loader_tags.py" in render
    70.                 result = block.nodelist.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render
    994.                 bit = node.render_annotated(context)
  
  File "C:\Python34\lib\site-packages\django\template\base.py" in render_annotated
    961.             return self.render(context)
  
  File "C:\Python34\lib\site-packages\django\template\defaulttags.py" in render
    166.             len_values = len(values)
  
  File "C:\Python34\lib\site-packages\django\db\models\query.py" in __len__
    238.         self._fetch_all()
  
  File "C:\Python34\lib\site-packages\django\db\models\query.py" in _fetch_all
    1085.             self._result_cache = list(self.iterator())
  
  File "C:\Python34\lib\site-packages\django\db\models\query.py" in __iter__
    54.         results = compiler.execute_sql()
  
  File "C:\Python34\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql
    835.             cursor.execute(sql, params)
  
  File "C:\Python34\lib\site-packages\django\db\backends\utils.py" in execute
    79.             return super(CursorDebugWrapper, self).execute(sql, params)
  
  File "C:\Python34\lib\site-packages\django\db\backends\utils.py" in execute
    64.                 return self.cursor.execute(sql, params)
  
  File "C:\Python34\lib\site-packages\django\db\utils.py" in __exit__
    94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
  
  File "C:\Python34\lib\site-packages\django\utils\six.py" in reraise
    685.             raise value.with_traceback(tb)
  
  File "C:\Python34\lib\site-packages\django\db\backends\utils.py" in execute
    64.                 return self.cursor.execute(sql, params)
  
  Exception Type: ProgrammingError at /
  Exception Value: relation "blog_blog" does not exist
  LINE 1: ..."."created_date", "blog_blog"."last_updated" FROM "blog_blog...
                                                           ^
  </code></pre>