【发布时间】:2011-12-17 20:46:22
【问题描述】:
我有一个使用 Django 的 Facebook 应用程序。在我的一个观点中,我使用以下代码让用户登录。
在 IE 中,返回 HttpResponseRedirect 行失败并显示错误消息“此内容无法在框架中显示...”,尽管其他浏览器工作正常。
你有什么想法,为什么 IE 对 HttpResponseRedirect 失败? (这是在 Windows 7 的 IE9 上产生的问题,服务器使用的是 django-1.3)
def auto_login(request):
username = request.GET['username']
password = request.GET['password']
user = authenticate(username=username, password=password)
if user is not None:
if user.is_active:
login(request, user)
theURL='http://apps.facebook.com/myapp/'
return HttpResponseRedirect(theURL)
else:
return HttpResponse("disabled account")
else:
return HttpResponse("Invalid login")
【问题讨论】:
-
有什么帮助吗?我仍然无法找出问题所在。
标签: django internet-explorer redirect