0

LinkedIn API を使用するのはこれが初めてです。私はジャンゴを使用しています。

github からプロジェクトに django allauth を追加しました。

settings.py で、LinkedIn を「INSTALLED APPS」に追加しました

Linkedin api でアプリケーションを作成しました。次に、ユーザー アクセス キーと秘密鍵を管理フェーズに追加しました。

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
'registration',
'django.contrib.humanize',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.linkedin', )
LOGIN_REDIRECT_URL = '/accounts/Dashboard/'
LOGIN_ERROR_URL = '/accounts/login_error/'
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',    
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.request",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"allauth.account.context_processors.account",
"allauth.socialaccount.context_processors.socialaccount",)

AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',    
"allauth.account.auth_backends.AuthenticationBackend",

)

urls.py

url(r'', include('allauth.urls')),

そして私のテンプレートで

<a href="{% url socialauth_begin 'linkedin' %}">linkedin</a>

リンクからログインしようとすると、URL が「/accounts/profile」にリダイレクトされ、「認証トークンが見つかりませんでした」というエラーが表示されます。

アクセス トークンの PIN を取得できない理由について、誰か洞察がありますか?

ありがとうございました。

4

0 に答える 0