无法登录本地主机中的管理站点

发布于 2024-09-25 11:25:09 字数 540 浏览 3 评论 0原文

我无法登录本地主机上的管理站点。

我尝试使用 Firefox、IE。

我尝试使用 127.0.0.1:8000 地址。另外,我将 SESSION_COOKIE_DOMAIN 设置为 localhostlocalhost: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不知所踪 2024-10-02 11:25:09

确保 /etc/hosts 中的 localhost 指向 127.0.0.1,将 SESSION_COOKIE_DOMAIN 设置为“localhost”(注意:端口号不是主机名的一部分),并使用适当的域和端口启动开发服务器,即:

./manage.py runserver localhost:8000

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:

./manage.py runserver localhost:8000

FWIW, I never had to mess with SESSION_COOKIE_DOMAIN in any Django version since the 0.96 days.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文