Kay Framework で認証に Twitter の OAuthを使ってみたがTwitterログインでボタンを押しても画面が変わらないし、エラーが出る時もある

37 views
Skip to first unread message

Aki Tanaka

unread,
Feb 3, 2013, 9:34:55 PM2/3/13
to kay-us...@googlegroups.com
お世話になっております。アキと申します。

以下のブログを基づいてまったく同じ設定をしました。
http://tnakamura.hatenablog.com/entry/20100524/kay_framework_twitter_oauth

そしてviews.pyは
.............
@login_required
def index(request):
  return render_to_response('fbtwitter/index.html')
..............

ログインが成功すればHelloが表示されるindex.html

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Top Page - fbtwitter</title>
</head>
<body>
  <p>Hello</p>    
 
</body>
</html>

Twitter Appの Callback URLがあまりわかりませんですが適当にいれても大丈夫ですか?
説明書に"Where should we return after successfully authenticating? For @Anywhere applications, only the domain specified in the callback will be used. OAuth 1.0a applications should explicitly specify their oauth_callback URL on the request token step, regardless of the value given here. To restrict your application from using callbacks, leave this field blank."
と書いているのでサイトのindex.htmlに戻るためにhttp://fbtwitt...@appspot.comを設定しました。

CallbackURLを設定したら二乗設定になるのではないか?1回目はviews.pyで@login_requiredがある。ログインが成功すればindex.htmlに入ることです。
2回目はCallbackURLを設定することです。
だれか説明していただけませんでしょうか。

Browerでhttp://localhost:8084にアクセスすれば画像1のように画面が出るときがTwitterログインでボタンを押したら画像2になる

Browerでhttp://localhost:8084にアクセスすれば画像2のように画面が出るときがある

助けていただければ幸いです。
どうぞよろしくお願い申し上げます。
アキ



Reply all
Reply to author
Forward
0 new messages