Django中管理员和应用程序的不同会话 [英] Different sessions for admin and applications in Django
本文介绍了Django中管理员和应用程序的不同会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为Django管理界面和应用程序本身提供不同的会话,以便能够以管理员身份登录到管理界面并作为应用程序的标准用户。
I'd like to have different sessions for the Django admin interface and applications themselves to be able to login as admin to the admin interface and as a standard user to the application.
任何想法如何实现?
PS
当然,我可以使用2种不同的网络浏览器实例,其他任何方式?
P.S. Sure, I can use 2 different web browser instances, any other ways?
推荐答案
在过去是有两个不同的网址。 www.example.com和admin.example.com。由于会话存储在Cookie中,而且Cookie是特定于域的,您可以同时使用这两个。
The way I have solved this in the past is to have 2 different urls. www.example.com and admin.example.com. As the sessions are stored in cookies, and the cookies being domain specific you can use both at the same time.
这篇关于Django中管理员和应用程序的不同会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文