質問編集履歴
4
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
HerokuでTwitter認証が上手くいかないです。
|
2
2
|
|
3
|
-
Twitterの認証画面まではいくのですが、自分のwebサイトに移動しようとするとServer Error (500)と表示されます
|
3
|
+
Twitterの認証画面まではいくのですが、自分のwebサイトに移動しようとするとServer Error (500)と表示されます。
|
4
4
|
|
5
5
|
|
6
6
|
|
3
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,6 +23,8 @@
|
|
23
23
|
Callback URLsはこれ以外を試すと認証画面にすらいきません
|
24
24
|
|
25
25
|
リダイレクト先の設定が悪いのでしょうか?
|
26
|
+
|
27
|
+
何か考えられることはあるでしょうか?教えていただけないでしょうか?
|
26
28
|
|
27
29
|
|
28
30
|
|
2
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,6 +27,90 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
```settings
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
INSTALLED_APPS = [
|
34
|
+
|
35
|
+
'map',
|
36
|
+
|
37
|
+
'accounts',
|
38
|
+
|
39
|
+
'django.contrib.admin',
|
40
|
+
|
41
|
+
'django.contrib.auth',
|
42
|
+
|
43
|
+
'django.contrib.contenttypes',
|
44
|
+
|
45
|
+
'django.contrib.sessions',
|
46
|
+
|
47
|
+
'django.contrib.messages',
|
48
|
+
|
49
|
+
'django.contrib.staticfiles',
|
50
|
+
|
51
|
+
'social_django', #追加
|
52
|
+
|
53
|
+
'cloudinary',
|
54
|
+
|
55
|
+
'cloudinary_storage',
|
56
|
+
|
57
|
+
]
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
TEMPLATES = [
|
62
|
+
|
63
|
+
{
|
64
|
+
|
65
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
66
|
+
|
67
|
+
'DIRS': [
|
68
|
+
|
69
|
+
os.path.join(BASE_DIR, 'templates'),
|
70
|
+
|
71
|
+
],
|
72
|
+
|
73
|
+
'APP_DIRS': True,
|
74
|
+
|
75
|
+
'OPTIONS': {
|
76
|
+
|
77
|
+
'context_processors': [
|
78
|
+
|
79
|
+
'django.template.context_processors.debug',
|
80
|
+
|
81
|
+
'django.template.context_processors.request',
|
82
|
+
|
83
|
+
'django.contrib.auth.context_processors.auth',
|
84
|
+
|
85
|
+
'django.contrib.messages.context_processors.messages',
|
86
|
+
|
87
|
+
'social_django.context_processors.backends', #追加
|
88
|
+
|
89
|
+
'social_django.context_processors.login_redirect', #追加
|
90
|
+
|
91
|
+
],
|
92
|
+
|
93
|
+
},
|
94
|
+
|
95
|
+
},
|
96
|
+
|
97
|
+
]
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
AUTHENTICATION_BACKENDS = [
|
102
|
+
|
103
|
+
'social_core.backends.google.GoogleOAuth2', #Google
|
104
|
+
|
105
|
+
'social_core.backends.twitter.TwitterOAuth', #Twitter
|
106
|
+
|
107
|
+
'social_core.backends.facebook.FacebookOAuth2', #Facebook
|
108
|
+
|
109
|
+
'django.contrib.auth.backends.ModelBackend',
|
110
|
+
|
111
|
+
]
|
112
|
+
|
113
|
+
|
30
114
|
|
31
115
|
LOGIN_REDIRECT_URL = '/'
|
32
116
|
|
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -70,6 +70,6 @@
|
|
70
70
|
|
71
71
|
```herokulogs
|
72
72
|
|
73
|
-
2020-03-30T13:08:29.264942+00:00 app[web.1]: 10.31.231.42 - - [30/Mar/2020:22:08:29 +0900] "GET /auth/complete/twitter/?redirect_state=m1ZJ0Wl83WYaw8dmE9W296VsoguCpLSE&oauth_token=RCkqHAAAAAABCjScAAABcSuOt2I&oauth_verifier=J75JScs77dZiQ10OgT1bXfrD5WIhA31G HTTP/1.1" 500 27 "https://api.twitter.com/oauth/authenticate?oauth_token=RCkqHAAAAAABCjScAAABcSuOt2I&redirect_uri=https%3A%2F%2F
|
73
|
+
2020-03-30T13:08:29.264942+00:00 app[web.1]: 10.31.231.42 - - [30/Mar/2020:22:08:29 +0900] "GET /auth/complete/twitter/?redirect_state=m1ZJ0Wl83WYaw8dmE9W296VsoguCpLSE&oauth_token=RCkqHAAAAAABCjScAAABcSuOt2I&oauth_verifier=J75JScs77dZiQ10OgT1bXfrD5WIhA31G HTTP/1.1" 500 27 "https://api.twitter.com/oauth/authenticate?oauth_token=RCkqHAAAAAABCjScAAABcSuOt2I&redirect_uri=https%3A%2F%2Fhogehoge.herokuapp.com%2Fauth%2Fcomplete%2Ftwitter%2F%3Fredirect_state%3Dm1ZJ0Wl83WYaw8dmE9W296VsoguCpLSE" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36"
|
74
74
|
|
75
75
|
```
|