Tell me, please, what a mistake when opening a model on the site through the admin. Model table-bundles.

enter image description here

ProgrammingError at / admin / cannabis / drugformation / column does not exist LINE 1: SELECT "drug_formation". "Id", "drug_formation". "Fk_drug", "d ...
^
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/cannabis/drugformation/
Django Version: 1.11.12
Exception Type: ProgrammingError
Exception Value:
column drug_formation.id does not exist
LINE 1: SELECT "drug_formation". "Id", "drug_formation". "Fk_drug", "d ...
^
Exception Location: /Users/Sabina/djangogirls/myvenv/lib/python3.6/site-packages/django/db/backends/utils.py in execute, line 64
Python Executable: / Users / Sabina / djangogirls / myvenv / bin / python
Python Version: 3.6.3
Python Path:
['/ Users / Sabina / djangogirls',' /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python36.zip ',' / usr / local / Cellar / python3 /3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6 ',' /usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3. 6 / lib-dynload ',' /Users/Sabina/djangogirls/myvenv/lib/python3.6/site-packages']
Server time: Mon, 6 Aug 2018 09:32:18 +0300

  • Column, from which you are trying to select data does not exist, look at the answer from @floydya - Klimenkomud

1 answer 1

Perform the migration:

python manage.py makemigrations python manage.py migrate 
  • did not help ((but thanks!) - Sabina
  • @Sabina try to comment out this field in the model, run these 2 commands. Then uncomment and repeat the execution of commands again. - floydya