No such table: main.auth_user__old

Doing the Python Programming for Developers course. Ran into issue video 9 Customizing the Admin in 10- Building Web Applications with Django (115m).

Upon trying to add a new genre to the DB getting error:

OperationalError at /admin/movies/genre/add/

no such table: main.auth_user__old

any help would be appreciated.

Thank you,

1 Like

You have to install the latest version of Django. You cannot go by the version the Mosh installed in the course.

1 Like

OperationalError at /admin/information/accounts/add/

no such table: main.auth_user__old

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/information/accounts/add/
Django Version: 3.1.6
Exception Type: OperationalError
Exception Value: no such table: main.auth_user__old
Exception Location: C:\Users\sukhb\PycharmProjects\accounts\venv\lib\site-packages\django\db\backends\sqlite3\base.py, line 413, in execute
Python Executable: C:\Users\sukhb\PycharmProjects\accounts\venv\Scripts\python.exe
Python Version: 3.9.0
Python Path: [‘C:\Users\sukhb\PycharmProjects\accounts’, ‘C:\Users\sukhb\AppData\Local\Programs\Python\Python39\python39.zip’, ‘C:\Users\sukhb\AppData\Local\Programs\Python\Python39\DLLs’, ‘C:\Users\sukhb\AppData\Local\Programs\Python\Python39\lib’, ‘C:\Users\sukhb\AppData\Local\Programs\Python\Python39’, ‘C:\Users\sukhb\PycharmProjects\accounts\venv’, ‘C:\Users\sukhb\PycharmProjects\accounts\venv\lib\site-packages’]
Server time: Wed, 17 Feb 2021 07:47:13 +0000

I AM ALSO FACING THE SAME PROBLEM PLEASE HELP

1 Like

``Steps to fix:

Stopped the django webserver running, Ctrl-C
Delete the db.sqlite3
Uninstalled Django old verison
Install latest version of Django with “pip install django” or this latest version 3.1.7
Issue “python manage.py makemigrations”
Issue “python manage.py migrate”
Create a superuser with “python manage.py createsuperuser”
Issue “python manage.py runserver” (or port 8080)
Navigate to http://127.0.0.1:8000/admin/
You will successfully able to add table manually.

12 Likes

thank you!! it works!!

no such table: main.auth_user__old
got this error when following the course of mosh. I referred to the answers of the previous people who have got this so I installed the new version of Django and it still didn’t work. pls give me a hand!! Im stuck…

Please update django, THEN delete db.sqlite3 and do all the db mirgation all again and run it. Only delete the db.sqlite3 AFTER you upgrade the django

Please update django, THEN delete db.sqlite3 and do all the db mirgation all again and run it. Only delete the db.sqlite3 AFTER you upgrade the django

Thanks a lot,
this totally worked for me. I installed the old and reinstalled the new version first and then deleted db.sqlite3, but the rest worked just fine. Thank you!

man thanks you saved me a lot of time

thank you…you saved my searching time.

Also had this problem just now in the course. For me it took 10 minutes to copy the code to a new project with the latest version of Django in it. Simple solution, didn’t need to delete anything.