简体   繁体   中英

Spaces and special characters in URL - django

My URL is as follows:

test/One%20**&**%20Two/edit

Django URLs:

r'^(?P<test>[\w\-]+)/(?P<text>[\w\s]+)/edit/$'

Can anyone tell me why Django is not able to display page? I see Page not found (404).

If you really need to capture all this garbage into the second group, just use:

^(?P<test>[\\w\\-]+)/(?P<text>.+)/edit/?$

... and I'm not even asking why you're willing to do so (:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM