django - url with automatic slash adding

2019-06-19 03:07发布

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.

标签: django url slash
1条回答
虎瘦雄心在
2楼-- · 2019-06-19 03:22

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

查看更多
登录 后发表回答