Django no such table: django_site after deleting migrations and database

Solution 1:

I've recently had the same problem, and turns out that I was using Site.object.get_current() in other place, at same time I add it 'django.contrib.sites', to INSTALLED_APPS and SITE_ID=1.

After trying all solutions that I found here without luck. I comment the line Site.object.get_current() and execute

python manage.py makemigrations
python manage.py migrate

And it worked.

Those same lines didn't work when I've Site.object.get_current()

I assume that in some way it raises an error and is caught as a too global Exception class.

I'm using Django 3.2.10.