[Django]-Django url pattern matching

6👍

You’re missing the last block of parens in your regular expression.

url(r'^baz/([a-z0-9]+)/([a-z0-9]+)/([0-9])/$', 'foobar.views.baz')

With the parens Python will capture the [0-9] as a group and now you’ll get all 3 parameters (+ the self) instead of 2.

Leave a comment