Getting this error “Exception Value: no such table: main.auth_user__old” when attempting to add the ‘Comedy’ genre via the web admin interface.
I’m following Mosh’s video 12.9 of Complete Python Mastery. I have followed all his instructions.
Here’s the exact error
" OperationalError at /admin/movies/genre/add/
python manage.py migrate
Still get the same result.
The stackoverflow eludes to a Django old-version incompatibility with newer SQLite. Perhaps that is a problem and Mosh should redo the videos with a newer Django version. Current version of Django is 3.1.1 as of today. In his video 12.9, Mosh’s version of Django requires 2.1. I will test out theory of newer Django version. If anyone has another idea, I’m open to the idea.
Solution: upgrade to latest Django version (at least 3.1.2)
Steps to fix:
I stopped the django webserver running, Ctrl-C
I kept my vidly app project as is according to Chapter 12.1-12.9.
I deleted the db.sqlite3
I uninstalled Django 2.1
I installed latest version of Django with “pip install django” which installed version 3.1.2
Issued “python manage.py makemigrations”
Issued “python manage.py migrate”
Created a superuser with “python manage.py createsuperuser”
Issued “python manage.py runserver”
Navigated to http://127.0.0.1:8000/admin/
I was successfully able to add two genres manually.
The Django version 2.1 is probably incompatible with the current version of SQLite. Mosh, please update the instructions to Complete Python Mastery Chapter 12 accordingly. I teach a university class and have all my students purchase your course. Great course, needs some updates please.
Your solution to ‘no table’ error while adding a product worked for me too. It seemed you were right, the older version of Django was not supported by newer version of SQLite.
I had the same problem and the solution of @shumpherys worked. Thank you for your help @shumpherys. Please @Mosh it would be helpful if you update this part.