django - 具有自动斜线添加的网址 [英] django - url with automatic slash adding
本文介绍了django - 具有自动斜线添加的网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
尝试在设置中将APPEND_SLASH设置为true。在第二个想法中,我认为默认设置为true。
http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs
I'm using django admin on my website. When I enter url without slash after admin (http://example.com/admin) I receive 404 error. I thought that django automatically added slash on the end of url. Of course when I enter url ended with slash it works fine. What I am doing wrong, or which settings I have to change. Thanks for any ideas.
解决方案
Try setting APPEND_SLASH to true in settings. On second thoughts, I think the default setting is true.
http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs
这篇关于django - 具有自动斜线添加的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文