无法登录本地主机中的管理站点
我无法登录本地主机上的管理站点。
我尝试使用 Firefox、IE。
我尝试使用 127.0.0.1:8000 地址。另外,我将 SESSION_COOKIE_DOMAIN
设置为 localhost
,localhost:8000
我将主机文件更改为:
127.0.0.1 test.com
并设置:
SESSION_COOKIE_DOMAIN = 'test.com'
我可以在生产中登录(仅在 SESSION_COOKIE_DOMAIN
配置之后)。
我正在使用 django rev 1.0.1。我无法升级到最后一个主干。最好的办法是升级到 1.0.2。
更新:我尝试将我的公共域添加到主机文件中,但不起作用(即:127.0.0.1 www.mysite.com
)。
I can't login to the admin site on localhost.
I try with firefox, IE.
I try using the 127.0.0.1:8000 address. Also, I set the SESSION_COOKIE_DOMAIN
to localhost
, localhost:8000
I change the host file to:
127.0.0.1 test.com
and set:
SESSION_COOKIE_DOMAIN = 'test.com'
I can login in production (only after the SESSION_COOKIE_DOMAIN
configuration).
I'm using django rev 1.0.1. I can't upgrade to last trunk. The best, is move to 1.0.2.
Update: I try adding to the host file my public domain, and not works (ie: 127.0.0.1 www.mysite.com
).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保 /etc/hosts 中的 localhost 指向 127.0.0.1,将 SESSION_COOKIE_DOMAIN 设置为“localhost”(注意:端口号不是主机名的一部分),并使用适当的域和端口启动开发服务器,即:
FWIW,自 0.96 天以来,我从来没有必要在任何 Django 版本中搞乱 SESSION_COOKIE_DOMAIN 。
Make sure you have localhost pointing to 127.0.0.1 in your /etc/hosts, set your SESSION_COOKIE_DOMAIN to 'localhost' (nb: port numbers are NOT part of the hostname) and start the dev server with the appropriate domain and port, ie:
FWIW, I never had to mess with SESSION_COOKIE_DOMAIN in any Django version since the 0.96 days.