Django get url path without using “request.path”

我与影子孤独终老i 提交于 2019-12-06 02:21:32

The 404 template will be rendered with a request context (unlike the 500 server error template).

Make sure that the django.core.context_processors.request context processor is in your TEMPLATE_CONTEXT_PROCESSORS setting. Note that it is not included by default.

Once you've done that, the request methods that you mention like get_full_path should work.

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