我正在按照django-allauth的文档进行安装,但是我无法manage.py migrate
。我在INSTALLED_APPS
和SITE_ID = 1
中包含了'django.contrib.sites'
,但是我得到了错误
django.db.utils.ProgrammingError: relation "django_site" already exists
我在运行Django 2.1.5。你知道吗
我找不到任何关于"django_site" already exists
的信息,只有"django_site" does not exist
。你知道吗
我在已安装的应用程序(不包括内部应用程序)中拥有的内容:
INSTALLED_APPS = (
'authtools',
'lot',
'bootstrap4',
'storages',
'oauth2_provider',
'bootstrap_pagination',
'dal',
'cloudinary',
'django_extensions',
'django_filters',
'reversion',
'constance',
'constance.backends.database',
'rest_framework',
'django_gravatar',
'messages_extends',
'cq',
'futon',
'memoize',
'jam',
'drf_aggregates',
'batch_requests',
'webpack_loader',
'django_prometheus',
# Core
'django.contrib.sites',
'django.contrib.postgres',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
# Channels
'channels',
'channels_redis',
# allauth
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
)
原来我以前有
django.contrib.sites
作为INSTALLED_APP
,所以迁移失败了。修复程序只是运行./manage.py migrate fake-initial
试试这个
在已安装的应用程序中,保持
'django.contrib.sites'
在顶部。你知道吗相关问题 更多 >
编程相关推荐