In the django doc the url function is like this
url(regex, view, kwargs=None, name=None, prefix='')
I have this
url(r'^download/template/(?P<object_id>\d+)/$', views.myview().myfunction,model=models.userModel, name="sample")
This is my view
class myview(TemplateView):
def myfunction(self,request, object_id, **kwargs):
model = kwargs['model']
I get this error
url() got an unexpected keyword argument 'model'
You are trying to pass in a
modelkeyword argument to theurl()function; you need to pass in akwargsargument instead (it takes a dictionary):