django database sqlite3 "no such a column" error

38 Views Asked by At

time to time i am facing "no such a column" error during django backend, django-admin development. when i face this issue, i cannot solve it. so that;

  1. i detele db.sqllite3 database file in my project location.
  2. i delete migrations files in application folder /djangioapp/migrations/
  3. i run makemigrations, migrate and createsuperuser commands.

i face with this error when i make changes on my Model. even more, i updated my model, i run makemigrations and migrate commands and i got this error no such a column when i try to access /admin in my djnago project.

actually, after making migrations with makemigrations and migrate; i see the changes in 0001_initial.py file but it does not apply in database.

is there any practical solution for "no such a column" error?

i face with this error when i make changes on my Model. even more, i updated my model, i run makemigrations and migrate commands and i got this error no such a column when i try to access /admin in my djnago project.

actually, after making migrations with makemigrations and migrate; i see the changes in 0001_initial.py file but it does not apply in database.

1

There are 1 best solutions below

1
Mahammadhusain kadiwala On

Try This commands

- python manage.py makemigrations your_app_name
- python manage.py migrate
- python manage.py runserver