In the Django urls I need an optional named group. This conf without arguments raised an 404 exception:
r'^list_cv/(?P<category>[\d]+)?/$'
How to make optional named group?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Works this way to me:
EDIT:
Comparing to the original answer the difference is in the repetition match.
(?:(?P<category>[\w+])/)?$vs original(?:(?P<category>[\w+])?/)$.