更改管理网站网址 [英] changing admin site url
本文介绍了更改管理网站网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以更改URL以在Django中打开管理站点?我不想使用默认的/admin网址.我是django的新手,所以请尝试提供一些更详细的信息.
Is there a way to change the url to open the admin site in django? I don't want to use the default /admin url. I am new to django so please try giving a bit more detailed information.
推荐答案
在urls.py中,更改以下行:
In urls.py, change the line that reads:
(r'^admin/(.*)', admin.site.root),
类似于:
(r'^new_admin/(.*)', admin.site.root),
现在使用
so now instead of http://example.com/admin you'd use http://example.com/new_admin
这篇关于更改管理网站网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文