2017-02-20 47 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

相關問題