[Answer]-Django url with more parameters

1👍

Your capturing groups match any characters, including the slash. You could fix this by putting the more specific one first, but it’s better in any case to constrain them a bit: a common format for slugs is alphanumeric characters plus dash. Also, you probably want to use + rather than *, as you will need at least one character for each group.

r'^(?P<language>[\w-]+)/(?P<shop>[\w-]+)/(?P<brand>[\w-]+)/$'

and the same for the other pattern.

Leave a comment