django url模式为%20 [英] django url pattern for %20

查看:350
本文介绍了django url模式为%20的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用(?P<名称> [\w] +),但这只处理字母数字字符,所以%导致错误

解决方案

我可以使用下面给出的配置使其工作。检查是否符合您的需要。

 (?P< name> [\w | \W] +)


In Django what is the url pattern I need to use to handle urlencode characters such as %20

I am using (?P<name>[\w]+) but this only handles alphanumeric characters so % is causing an error

解决方案

I was able to make it work using the configuration given below. Check if it will suit your needs.

(?P<name>[\w|\W]+)

这篇关于django url模式为%20的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆