DSA はすでに複数のアカウントの関連付けをサポートしています。秘訣は、ユーザーがログインしている必要があることです。ログインしていない場合、DSA は、既存のアカウントに関連付けられる必要があることを知りません。
プロファイルに関して、DSA に機能を追加する推奨される方法は、パイプラインを拡張することです。次のようなエントリを作成できます。
def create_profile(user, is_new=False, *args, **kwargs):
if is_new:
# create a profile instance for the given user
create_user_profile(user)
次に、次のように設定に登録します。
SOCIAL_AUTH_PIPELINE = (
'social_auth.backends.pipeline.social.social_auth_user',
'social_auth.backends.pipeline.user.get_username',
'social_auth.backends.pipeline.user.create_user',
'social_auth.backends.pipeline.social.associate_user',
'social_auth.backends.pipeline.social.load_extra_data',
'social_auth.backends.pipeline.user.update_user_details',
'myapp.pipeline.create_profile'
)
エントリは、その関数を取得するためのインポート パスです。
編集:ドキュメントへのリンクと設定の説明。