我打开浏览器,尝试访问我的Django站点.我已经退出了我的帐户,所以我被重定向到我的登录页面,我要将该页面作为GET参数.
http://website.com/login/?next=/customer/7/54
Run Code Online (Sandbox Code Playgroud)
但是,当我输入登录信息时,我会被重定向到:
http://website.com/
Run Code Online (Sandbox Code Playgroud)
尽管如此,我还是想:
http://website.com/customer/7/54
Run Code Online (Sandbox Code Playgroud)
/ customer/7/54指向一个确实有@login_required装饰器的视图,但我是在假设,我登录后它仍然指向该视图.发生了什么?
编辑:所以我意识到,我有一个隐藏的输入标签:
<input type="hidden" name="next" value='/'>
Run Code Online (Sandbox Code Playgroud)
但是,如何将GET参数'/ customer/7/54 /传入登录模板?
在制作时,我一直在尝试将djangosecure.middleware.SecurityMiddleware(来自http://pypi.python.org/pypi/django-secure)添加到我的设置中,但没有任何运气使它工作.
当我跑:
./manage.py checksecure
Run Code Online (Sandbox Code Playgroud)
一切都顺利通过.但我无法加载该网站.它给了我以下错误:
The webpage has resulted in too many redirects. Clearing your cookies for this site or
allowing third-party cookies may fix the problem. If not, it is possibly a server
configuration issue and not a problem with your computer.
Run Code Online (Sandbox Code Playgroud)
在本地,当我使用生产设置时,我收到一个页面错误:
Unable to make a secure connection to the server. This may be a problem with the server,
or it may be requiring a client authentication certificate that you don't have.
Run Code Online (Sandbox Code Playgroud)
我的终端然后充满了我无法解读的奇怪错误:
[12/Jan/2013 14:15:25] code …Run Code Online (Sandbox Code Playgroud)