我正在使用 python-social-auth。但是当我运行 makemigrations 并迁移时。未创建表“social_auth-*”。
我的 settings.py 看起来像这样
INSTALLED_APPS += (
'social.apps.django_app.default',
)
AUTHENTICATION_BACKENDS += (
'social.backends.facebook.FacebookOAuth2',
'social.backends.google.GoogleOAuth2',
'social.backends.twitter.TwitterOAuth',
)
SOCIAL_AUTH_USER_MODEL = AUTH_USER_MODEL
# Rausnehmen wenns Probleme mit der Auth. gibt
SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.social_user',
'social.pipeline.user.get_username',
'social.pipeline.social_auth.associate_by_email', # <--- enable this one. to match users per email adress
'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details',
)
from sharadar.soc_auth_config import *
在另一台机器上同样可以正常工作,没有任何缺陷。在这台机器上我收到:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, easy_thumbnailsguardian, main, myauth, sessions, social_auth
Running migrations:
Applying myauth.0002_auto_20170220_1408... OK
此处包含 social_auth。
但是在一台新电脑上我总是收到
Exception Value:
relation "social_auth_usersocialauth" does not exist
LINE 1: ...er"."bio", "myauth_shruser"."email_verified" FROM "social_au...
在我运行的 django 应用程序中使用 google auth 时
我运行 migrate 时不包括 social_auth
Operations to perform:
Apply all migrations: admin, auth, contenttypes, easy_thumbnails, guardian, myauth, sessions
Running migrations:
No migrations to apply.
感谢任何帮助。
亲切的问候
迈克尔
最佳答案
我必须按照本文档中的描述迁移到 social-auth-core :
Migrating from python-social-auth to split social
然后一切正常。但是在这个问题之后我正在考虑更改为所有授权。
问候任何帮助
关于python - 关系 "social_auth_usersocialauth"不存在。迁移不会创建这些表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42345745/