2017-02-20 48 views
2

我正在使用python-social-auth。但是当我运行makemigrations并迁移。表“social_auth- *”未创建。关系“social_auth_usersocialauth”不存在。迁移不会创建这些表

我的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应用程序不包含

social_auth当我运行迁移

Operations to perform: 
    Apply all migrations: admin, auth, contenttypes, easy_thumbnails, guardian, myauth, sessions 
Running migrations: 
    No migrations to apply. 

任何帮助appretiated。

亲切的问候

迈克尔

+0

你有两台不同的设置? –

+0

是的,我有一台电脑与工作设置。但是我无法让它在第二个 – mbieren

+0

上运行。在迁移自定义用户模型后,您的旧安装程序python-social-auth migrations可能已经运行。我的意思是在这种情况下迁移顺序可能很重要。您可以尝试在新设置中禁用python社交身份验证,运行迁移并安装它。 –

回答

0

奇怪..进入管理界面时,我收到异常:

No installed app with label 'social_django'. 

但后来在错误报告,我有:

INSTALLED_APPS 
    ['django.contrib.admin', 
    'django.contrib.auth', 
    ..... 
    'myauth.apps.MyauthConfig', 
    'main.apps.MainConfig', 
    'social.apps.django_app.default'] 

pip3搜索python-social-auth给出:

python-social-auth (0.3.6) 
    INSTALLED: 0.3.6 (latest) 

我不知道这里发生了什么事。

问候

迈克尔

+0

一看是你的工作在虚拟环境? –

+0

最初不是。但要交叉检查。我也创建了一个virtualenv,而且我也遇到了同样的问题。迁移不执行。表格不会被创建。 – mbieren

+0

我甚至创造了一个新的空项目“mysite的”一个应用程序“民意调查”,并列入INSTALLED_APPS那里,不进行迁移,无论我做什么蟒蛇 - 社会 - 身份验证? – mbieren

相关问题