Django Admin Error

Please @codewithmosh team respond to this problem because NOT attending to challenges encountered by your students is really a de-service to your business. I have had a number of unresolved problems posted on this forum and you never care. Since no fellow student is able to solve the problem for us, we feel abandoned.

This problem has previously be posted on this forum without a solution, see:

You seems to be bent on selling your courses and once our monies get to your bank account, you abandon us to our fate. This practice will earn you several thumbs-down if not reversed.

I am currently working on my first python/django project and on the django administration page i encountered the following problem: OperationalError at /admin/movies/genre/add/ no such table: main.auth_user__old Request Method: POST Request URL: http://127.0.0.1:8000/admin/movies/genre/add/ Django Version: 2.1 Exception Type: OperationalError Exception Value:
no such table: main.auth_user__old

Well, I have struggled through and resolved this on my own and I think I should share my experiences for other learners like me.

I stumbled over this thread on Stackoverflow: python - Django - No such table: main.auth_user__old - Stack Overflow and I implemented some of the solutions suggested but not all of them worked for me. The steps that worked for me are as follows:

  1. I deleted the db.sqlit3 database from my root folder.
  2. I did pipenv install django==2.1.5 which upgraded my django from version 2.1 to version 2.1.5.
  3. Since I am using Windows, I run the command python manage.py makemigrations and this command re-created the db.sqlite3 database for me.
  4. I run the command python manage.py migrate.
  5. I re-created super user with this command python manage.py createsuperuser.
  6. I run the server with python manage.py runserver.
  7. Then I opened the admin panel on web browser, login with the new admin credentials, added new genres and saved.

Everything worked just fine.

1 Like

This worked for me too.Thanks