I want a url that accepts all characters,for example:
(r'^company/(?P<key>[a-zA-Z]+)/doclist/$','CompanyHub.views.docList')
for key
parameter instead of just ascii alphabetic characters It accepts all characters include numbers,symbols like $,-,_,...,alphabet,unicode characters,...
how can I do this?
Your code should look like this:
(ur'^company/(?P<key>.*)/doclist/$','CompanyHub.views.docList')
We need the 'u' at the beginning to tell python that the string accepts unicode characters.
RegEx would look like this:
(.*)
That should match all characters except new line characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With