ログインに成功すると、ユーザーは適切な場所とすべてにリダイレクトされますが、URLには最後にいくつかの特別な記号があります。
これが私のログイン機能です:
def fb_login(request):
args = dict(client_id=FACEBOOK_APP_ID, redirect_uri=request.build_absolute_uri())
# the user is already logged into facebook
if 'code' in request.GET:
args['client_secret'] = FACEBOOK_APP_SECRET
args['code'] = request.GET.get('code')
response = urlparse.parse_qs(urllib.urlopen("https://graph.facebook"
".com/oauth/access_token?" +
urllib.urlencode(args)).read())
# A short lived access token
access_token = response['access_token'][0]
# Extending the short lived access token
args['grant_type'] = "fb_exchange_token"
args['fb_exchange_token'] = access_token
reponse2 = urlparse.parse_qs(urllib.urlopen("https://graph.facebook"
".com/oauth/access_token?" +
urllib.urlencode(args)).read())
token = Token.objects.create(token=reponse2['access_token'][0],
expires_in=int(reponse2['expires'][0]))
# do stuff with the token
return HttpResponseRedirect(reverse('profile'))
# the user is not logged into facebook yet
else:
return HttpResponseRedirect("https://graph.facebook.com/oauth/authorize?" +
urllib.urlencode(args))
この URL の代わりに:
http://localhost:8000/profile/
私はこれを得る:
http://localhost:8000/profile/#_=_
このように URL が変更される原因は何ですか?