[Fixed]-How to use reverse an url with extra arguments in a django template tag?

1👍

You can use the {% url ... as var %} syntax to first create the url for the action and then pass it as a parameter to the button_only_form tag:

<ul>
  {% for item in items %}
    <li>
      {% url "items:delete" item_id=item.id as del_url %} 
      {{item.title}} - 
      {% button_only_form "Delete" del_url "..." %}
    </li>
  {% endfor %}
</ul>

Leave a comment