Reputation: 11663
my url pattern is www.example.com/[any digit or number]
say www.eaxmple.com/slug
my urls.py is:
url(r'^(?P<[a-z0-9>+)/$', mymethod),
But is saying:- bad character in group name
another query is that i want to process the slug
coming with the url. Based on that value i will render different template. Is it possible? How?
Upvotes: 0
Views: 114
Reputation: 9391
I don't know python, so can't say what the url function does, but your regex should probably look like this:
url(r'^(?P<someName>[a-z0-9]+)/$', mymethod)
This will capture the the [a-z0-9] Group of characters under the name "someName".
BTW: What about upper case characters?
Upvotes: 7