Reputation: 135
<a href="{{ url('affiliate', affiliate=object.slug) }}">{{ object.name }} </a>
Cause an error: reverse() got an unexpected keyword argument 'affiliate'
Upvotes: 1
Views: 4017
Reputation: 5993
As your url()
function seem to be an alias to the Django's reverse()
, the function signature is different from the regular template tag. So just use the reverse()
syntax:
<a href="{{ url('affiliate', args=[object.slug]) }}">{{ object.name }}</a>
Upvotes: 5