# Django error 'no such table' adding 'Comedy' genre (Video 12.9 Complete Python Mastery course)

**URL:** <https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337>\
**Category:** Python\
**Created:** [October 28, 2020, 8:31pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337 "2020-10-28T20:31:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shumpherys](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/shumpherys/32/90_2.png) [@shumpherys](https://forum.codewithmosh.com/u/shumpherys)\
**Post date:** [October 28, 2020, 8:31pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/1 "2020-10-28T20:31:55Z")

</div>

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/

no such table: main.auth\_user\_\_old

| Request Method: | POST |
| --- | --- |
| Request URL: | [http://127.0.0.1:8000/admin/movies/genre/add/](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 |
| Exception Location: | C:\Users\me\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 296 |
| Python Executable: | C:\Users\me\AppData\Local\Programs\Python\Python38-32\python.exe |
| Python Version: | 3.8.5 |
| SQLite library version: | 3.32.2 |

I have attempted all the steps twice. I can add the genre values manually through DB browser, but not through the Django interface.  
I have found this help article [https://stackoverflow.com/questions/53637182/django-no-such-table-main-auth-user-old](https://stackoverflow.com/questions/53637182/django-no-such-table-main-auth-user-old)  
and followed the instructions to:

1. delete db.sqlite3
2. python manage.py makemigrations
3. 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.

---

<div class="post-metadata">

**Author:** ![shumpherys](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/shumpherys/32/90_2.png) [@shumpherys](https://forum.codewithmosh.com/u/shumpherys)\
**Post date:** [October 28, 2020, 8:53pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/2 "2020-10-28T20:53:21Z")

</div>

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/](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.

---

<div class="post-metadata">

**Author:** ![Zuber](https://avatars.discourse-cdn.com/v4/letter/z/ed8c4c/32.png) [@Zuber](https://forum.codewithmosh.com/u/Zuber)\
**Post date:** [November 4, 2020, 9:30pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/3 "2020-11-04T21:30:43Z")

</div>

Thanks shumpherys,

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.

---

<div class="post-metadata">

**Author:** ![RizwanZahir](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@RizwanZahir](https://forum.codewithmosh.com/u/RizwanZahir)\
**Post date:** [November 9, 2020, 7:04am UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/4 "2020-11-09T07:04:23Z")

</div>

It is working. Thank you sir.

---

<div class="post-metadata">

**Author:** ![daczarne](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/daczarne/32/426_2.png) [@daczarne](https://forum.codewithmosh.com/u/daczarne)\
**Post date:** [December 14, 2020, 2:18pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/5 "2020-12-14T14:18:54Z")

</div>

Thanks shumpherys!! works like a charm!!

---

<div class="post-metadata">

**Author:** ![Interstellar](https://avatars.discourse-cdn.com/v4/letter/i/f17d59/32.png) [@Interstellar](https://forum.codewithmosh.com/u/Interstellar)\
**Post date:** [March 1, 2021, 4:54pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/6 "2021-03-01T16:54:03Z")

</div>

Thank you very much! Appreciated!!!

---

<div class="post-metadata">

**Author:** ![PoupayNinja](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@PoupayNinja](https://forum.codewithmosh.com/u/PoupayNinja)\
**Post date:** [August 6, 2021, 8:51pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/8 "2021-08-06T20:51:07Z")

</div>

Thanks. Very clear instructions.

---

<div class="post-metadata">

**Author:** ![luifrancgom](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/luifrancgom/32/753_2.png) [@luifrancgom](https://forum.codewithmosh.com/u/luifrancgom)\
**Post date:** [November 6, 2021, 1:21am UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/9 "2021-11-06T01:21:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Spondicious](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/spondicious/32/2676_2.png) [@Spondicious](https://forum.codewithmosh.com/u/Spondicious)\
**Post date:** [March 13, 2022, 1:17pm UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/10 "2022-03-13T13:17:12Z")

</div>

And a big thanks from me too…

---

<div class="post-metadata">

**Author:** ![stephenreid90](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@stephenreid90](https://forum.codewithmosh.com/u/stephenreid90)\
**Post date:** [April 13, 2022, 1:59am UTC](https://forum.codewithmosh.com/t/django-error-no-such-table-adding-comedy-genre-video-12-9-complete-python-mastery-course/337/11 "2022-04-13T01:59:49Z")

</div>

Appreciate the suggestion here - thanks @shumpherys . Didn’t work for me, though - frustrating, given how great most of the course is!
