title: Django: Column does not exist
body: <p>So I just pushed an update to the web server and did <code>makemigrations</code> then <code>migrate</code> and everything seems ok, then when I refresh the website page I got this error</p>
  
  <p><strong>Traceback:</strong></p>
  
  <pre><code>Environment:
  
  
  Request Method: GET
  Request URL: http://0.0.0.0/
  
  Django Version: 2.0.2
  Python Version: 3.5.2
  Installed Applications:
  ['django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'HomePage',
   'widget_tweaks',
   'Cart']
  
  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 /home/django/LovelyMemory/HomePage/templates/HomePage/base.html,                 error at line 8
     column HomePage_product.category_id does not exist
  LINE 1: SELECT "HomePage_product"."id", "HomePage_product"."category...
                                      ^
  
     1 : {% load static %}
     2 : &lt;!DOCTYPE html&gt;
     3 : &lt;html lang="en"&gt;
     4 : 
     5 : &lt;head&gt;
     6 :     &lt;meta charset="utf-8"&gt;
     7 :     &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
     8 :     &lt;meta name="viewport" content="width =device-width, initial-scale=     1"&gt;
     9 : 
     10 :     &lt;title&gt;{% block title %} Lovely Memory {% endblock %}&lt;/title&gt;
     11 : 
     12 :     &lt;link rel="stylesheet" type="text/css" href="{% static     'css/style.css' %}"/&gt;
     13 :     &lt;link     href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.1/minty/bootstrap.min.css    " rel="stylesheet"
     14 :           integrity="sha384-    4eGtnTOp6je5m6l1Zcp2WUGR9Y7kJZuAiD3Pk2GAW3uNRgHQSIqcrcAxBipzlbWP"     crossorigin="anonymous"&gt;
     15 :     &lt;script defer     src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"&gt;&lt;/script&gt;
     16 :     &lt;!--[if lt IE 9]&gt;
     17 :       &lt;script     src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"&gt;&lt;/script&gt;
     18 :       &lt;script     src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
  
  
  Traceback:
  
  File "/home/django/venv/lib/python3.5/site-    packages/django/db/backends/utils.py" in _execute
    85.                 return self.cursor.execute(sql, params)
  
  The above exception (column HomePage_product.category_id does not exist
  LINE 1: SELECT "HomePage_product"."id", "HomePage_product"."category...
                                      ^
  ) was the direct cause of the following exception:
  
  File "/home/django/venv/lib/python3.5/site-    packages/django/core/handlers/exception.py" in inner
    35.             response = get_response(request)
  
  File "/home/django/venv/lib/python3.5/site-    packages/django/core/handlers/base.py" in _get_response
    128.                 response = self.process_exception_by_middleware(e,     request)
  
  File "/home/django/venv/lib/python3.5/site-    packages/django/core/handlers/base.py" in _get_response
    126.                 response = wrapped_callback(request, *callback_args,     **callback_kwargs)
  
  File "/home/django/LovelyMemory/HomePage/views.py" in product_list
    25.     return render(request, 'HomePage/list.html', context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/shortcuts.py" in     render
    36.     content = loader.render_to_string(template_name, context, request,     using=using)
  
  File "/home/django/venv/lib/python3.5/site-    packages/django/template/loader.py" in render_to_string
    62.     return template.render(context, request)
  
  File "/home/django/venv/lib/python3.5/site-    packages/django/template/backends/django.py" in render
    61.             return self.template.render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py"     in render
    175.                     return self._render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py"     in _render
    167.         return self.nodelist.render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in render
    943.                 bit = node.render_annotated(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in render_annotated
    910.             return self.render(context)
  
  File "/home/django/venv/lib/python3.5/site-        packages/django/template/loader_tags.py" in render
    155.             return compiled_parent._render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in _render
    167.         return self.nodelist.render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in render
    943.                 bit = node.render_annotated(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in render_annotated
    910.             return self.render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/loader_tags.py" in render
    67.                 result = block.nodelist.render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in render
    943.                 bit = node.render_annotated(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/base.py" in render_annotated
    910.             return self.render(context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/template/defaulttags.py" in render
    168.             len_values = len(values)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/models/query.py" in __len__
    254.         self._fetch_all()
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/models/query.py" in _fetch_all
    1179.             self._result_cache = list(self._iterable_class(self))
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/models/query.py" in __iter__
    53.         results =     compiler.execute_sql(chunked_fetch=self.chunked_fetch,     chunk_size=self.chunk_size)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
    1064.             cursor.execute(sql, params)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
    100.             return super().execute(sql, params)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
    68.         return self._execute_with_wrappers(sql, params, many=False,     executor=self._execute)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
    77.         return executor(sql, params, many, context)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute
    85.                 return self.cursor.execute(sql, params)
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/utils.py" in __exit__
    89.                 raise dj_exc_value.with_traceback(traceback) from     exc_value
  
  File "/home/django/venv/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute
    85.                 return self.cursor.execute(sql, params)
  
  Exception Type: ProgrammingError at /
  Exception Value: column HomePage_product.category_id does not exist
  LINE 1: SELECT "HomePage_product"."id", "HomePage_product"."category...
                                      ^
  </code></pre>
  
  <p>So I deleted all previous migrations and even <code>flush</code> the database and this error is still on</p>
  
  <p><strong>My set up:</strong></p>
  
  <p>Django (2.0.2)</p>
  
  <p>gunicorn (19.7.1)</p>
  
  <p>PostgreSQL</p>
  
  <p>any thought on how to solve this?</p>
  
  <p>this is the migration
  <a href="https://i.stack.imgur.com/4W74Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4W74Y.png" alt="migration"></a></p>
  
  <p>This is my migrations folder
  <a href="https://i.stack.imgur.com/sBrHv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sBrHv.png" alt="Folder"></a></p>