2
Try adding django.contrib.sites
in your INSTALLED_APPS
and set SITE_ID=1
in your settings.py
.
It’s shown from the error:
Field defines a relation with model ‘Site’, which is either not installed, or is abstract.
And from the migration file source code:
dependencies = [ ('sites', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '0001_initial'), ]
It suggested that django.contrib.sites
is indeed a dependency app.
Edited:
In fact, this is included from the docs Quick start guide:
Enable the “sites” framework by adding ‘django.contrib.sites’ to
INSTALLED_APPS
and definingSITE_ID
.
Source:stackexchange.com