thirumalairaj
thirumalairaj

Reputation: 37

django multiple values for keyword 'template'

Is It possible in django 1.4

url(r'^(comment|review|feedback|suggestion)$',direct_to_template,{'template':'sample.html'}),

I tried and got

direct_to_template() got multiple values for keyword argument 'template'

Upvotes: 0

Views: 49

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599610

You're capturing the value from the URL - comment, review etc - and sending that to the template, but also hard-coding the template variable as "sample.html". But direct_to_template only expects one parameter, which is the template, so both values are being sent to the same parameter.

I'm not quite sure why you are doing this, but you could avoid capturing the value:

r'^comment|review|feedback|suggestion$'

Upvotes: 3

Related Questions