Django Error – django.db.utils.OperationalError: no such table

Django “no such table” error of death..

I recently encountered this “no such table” error while trying to run makemigrations command on PyCharm.

I dropped database tables related to my app, cleaned django_migrations table for this app, cleared migrations folder as described in this post: http://big.info/2016/07/django-clear-migrations-re-migrate.html. Then I ran makemigrations… No such table..

I did lots of googling but none of the solutions I found was applicable to my case. After some inspection of the error messages generated, I found out that one of the forms in my forms.py was trying to access a database that I had deleted. I commented out this form’s code and re-run makemigrations command. This time it was successful.

Hope this helps.
Good Luck,
Serdar

Serdar Osman Onur
I love coding web stuff, learning/applying new technologies and techniques to create things on the internet since 2004. AboutMe G+ twitter
Serdar Osman Onur

@serdarosmanonur

hard work, determination, dedication, patience, consistency, faith
"We forge our bodies in the fire of our will" - Enter the Dragon - 1973 - 4 days ago
Serdar Osman Onur