使用django-allauth,makemigrations遇到RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
查了一些资料,发现除了需要加django-allauth的一些应用外,在INSTALLED_APPS中,还需要加入django.contrib.sites。如下:
INSTALLED_APPS = [
...
'django.contrib.sites',
]
SITE_ID = 1
然后迁移数据即可。