yuretzgt, Красным цветом показывает это {% for article in Article %}, но до того как я ввел весь код связанный с imagefield, все нормально было, так что я не уверен что он ошибку выделяет
Красным цветом показывает это {% for article in Article %}, но до того как я ввел весь код связанный с imagefield, все нормально было, так что я не уверен что он ошибку выделяет
yuretzgt, OperationalError at /
no such column: testsite_article.image
Request Method: GET
Request URL: 127.0.0.1:8000
Django Version: 2.2
Exception Type: OperationalError
Exception Value:
no such column: testsite_article.image
Exception Location: C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 383
Python Executable: C:\Users\Костя\AppData\Local\Programs\Python\Python37\python.exe
Python Version: 3.7.2
Python Path:
['C:\\Users\\Костя\\Desktop\\delete\\deletee',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\lib',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\win32',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\win32\\lib',
'C:\\Users\\Костя\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\Pythonwin']
Server time: Сб, 14 Дек 2019 20:18:35 +0600
Error during template rendering
In template C:\Users\Костя\Desktop\delete\deletee\testsite\templates\index.html, error at line 9
no such column: testsite_article.image
1 {% load static %}
2
3
4
5
6 Blog
7
8
9 {% for article in Article %}
10
11 {{article.title}}
12
13
14 {{article.text}}
15
16
17
18 {{article.published}}
19
Traceback Switch to copy-and-paste view
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py in _execute
return self.cursor.execute(sql, params) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\sqlite3\base.py in execute
return Database.Cursor.execute(self, query, params) …
▶ Local vars
The above exception (no such column: testsite_article.image) was the direct cause of the following exception:
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\exception.py in inner
response = get_response(request) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py in _get_response
response = self.process_exception_by_middleware(e, request) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs) …
▶ Local vars
C:\Users\Костя\Desktop\delete\deletee\testsite\views.py in index
return render(request,'index.html',{'Article':ss,'forms':forms}) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\shortcuts.py in render
content = loader.render_to_string(template_name, context, request, using=using) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\loader.py in render_to_string
return template.render(context, request) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\backends\django.py in render
return self.template.render(context) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\base.py in render
return self._render(context) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\base.py in _render
return self.nodelist.render(context) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\base.py in render
bit = node.render_annotated(context) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\base.py in render_annotated
return self.render(context) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\template\defaulttags.py in render
len_values = len(values) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py in __len__
self._fetch_all() …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py in _fetch_all
self._result_cache = list(self._iterable_class(self)) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\sql\compiler.py in execute_sql
cursor.execute(sql, params) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py in execute
return super().execute(sql, params) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py in _execute_with_wrappers
return executor(sql, params, many, context) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py in _execute
return self.cursor.execute(sql, params) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\utils.py in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py in _execute
return self.cursor.execute(sql, params) …
▶ Local vars
C:\Users\Костя\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\sqlite3\base.py in execute
return Database.Cursor.execute(self, query, params) …
▶ Local vars