Let's say I have a url which captures several argument. E.g:
url(r'^(?P<l_slug>[-\w]+)/(?P<t_slug>[-\w]+)/(?P<event_id>\d+)/$', 'views.SomeView'),
And in some cases, SomeView needs only one of the argument: E.g:
def SomeView(request, event_id):
return HttpResponse('hi {}'.format(event_id))
The way I have been handling this issue is:
def SomeView(request, l_slug=None, t_slug=None, event_id=None):
return HttpResponse('hi {}'.format(event_id))
Is there some what to limit what arguments are passed to the view from the url line?