def your_func(self, request, object_id, **kwargs):
    print('Foo', self.foo)
self.foo = 'bar'
return http.HttpResponse('foo')
urlpatterns = patterns('test_app.views', url(
    '^download/template/(?P<object_id>\\d+)/$', YourView().your_func,
    kwargs=dict(model=User), name='sample'))
How can I pass kwargs in URL in django