i’m working with django. i want a page to work with parameter and without it. i tried using ‘*’ in url like this and it didn’t work:
url(r'^ask/(?P<pageNo>\d*)/$',
'ask'),
so i think i have to write two urls for my page, one with parameter and the other without it, like this:
url(r'^ask/$',
'ask'),
url(r'^ask/(?P<id>\d+)/$',
'ask'),
it works with parameter, but without it, doesn’t work. would you mind please helping me? thank you.
Yes, you will have to define 2 urls.
Define your view which takes parameter with default value.