Ahmet
Ahmet

Reputation: 1

django database sqlite3 "no such a column" error

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.

Upvotes: 0

Views: 38

Answers (1)

Mahammadhusain kadiwala
Mahammadhusain kadiwala

Reputation: 3650

Try This commands

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

Upvotes: 0

Related Questions