[Django]-Makemigrations error : django.db.utils.OperationalError: no such table

3👍

Add django.contrib.sites in your INSTALLED_APPS and the run migrate command

python manage.py makemigrations
python manage.py migrate

Hope this helps you

8👍

Your sendEmails module has a query at the top level: Site.objects.get_current(). This is run when the module is imported, before migrations have had a chance to run.

You must not do any database actions at this level; put it into a method.

3👍

In this case some migrations are still pending so run python manage.py migrate and python manage.py makemigrations app_name

1👍

Change "django.contrib.admin" in INSTALLED_APPS to "django.contrib.admin.apps.SimpleAdminConfig" and then run makemigrations command. after that you can revert your changes.

0👍

python manage.py migrate
python manage.py makemigrations

Worked for me, had pending migrations.

Leave a comment