error at line 0. i am trying to use image in my blog post

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/

Django Version: 3.1.5
Python Version: 3.9.1
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 C:\Users\user\pyproj\web_development\blog\templates\base.html, error at line 0
no such column: blog_post.image
1 : <!doctype html>
2 :
3 :
4 :
5 :
6 :
7 :
8 :
9 :
10 :

Traceback (most recent call last):
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\utils.py”, line 84, in _execute
return self.cursor.execute(sql, params)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\sqlite3\base.py”, line 413, in execute
return Database.Cursor.execute(self, query, params)

The above exception (no such column: blog_post.image) was the direct cause of the following exception:
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\core\handlers\exception.py”, line 47, in inner
response = get_response(request)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\core\handlers\base.py”, line 204, in _get_response
response = response.render()
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\response.py”, line 105, in render
self.content = self.rendered_content
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\response.py”, line 83, in rendered_content
return template.render(context, self._request)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\backends\django.py”, line 61, in render
return self.template.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 170, in render
return self._render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 162, in _render
return self.nodelist.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 938, in render
bit = node.render_annotated(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 905, in render_annotated
return self.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\loader_tags.py”, line 150, in render
return compiled_parent._render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 162, in _render
return self.nodelist.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 938, in render
bit = node.render_annotated(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 905, in render_annotated
return self.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\loader_tags.py”, line 62, in render
result = block.nodelist.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 938, in render
bit = node.render_annotated(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\base.py”, line 905, in render_annotated
return self.render(context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\template\defaulttags.py”, line 168, in render
len_values = len(values)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\models\query.py”, line 269, in len
self._fetch_all()
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\models\query.py”, line 1308, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\models\query.py”, line 53, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\models\sql\compiler.py”, line 1156, in execute_sql
cursor.execute(sql, params)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\utils.py”, line 98, in execute
return super().execute(sql, params)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\utils.py”, line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\utils.py”, line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\utils.py”, line 84, in _execute
return self.cursor.execute(sql, params)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\utils.py”, line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\utils.py”, line 84, in _execute
return self.cursor.execute(sql, params)
File “C:\Users\user\pyproj\my_env\lib\site-packages\django\db\backends\sqlite3\base.py”, line 413, in execute
return Database.Cursor.execute(self, query, params)

Exception Type: OperationalError at /
Exception Value: no such column: blog_post.image

That error tells you where the problem is. If you need help finding what’s causing that error, we’re going to need to see some of your code.

Please post the view that is trying to render this page and the associated model. (When posting code, enclose it between lines of three backtick - ` characters. You’ll have 1 line of ```, followed by your lines of code, followed by another line of ```.)

This looks like a missing migration. You probably updated your blog_post model but haven’t run manage.py makemigrations and manage.py migrate.

Thank u. Sure i will