django - url with automatic slash adding

人盡茶涼 提交于 2020-02-23 09:35:54

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/4438064/django-url-with-automatic-slash-adding

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!