'Passing multiple parameters to django url template

I am trying to pass multiple url parameters from a django templated to be used by a view function. Below are my codes :

A snippet from the template from where the parameters will be passed onto :

<a href="{% url 'coordinator_assign_project_recommendations' group_id=row.group client_id=row.client  project_id=row.project_id %}" class="btn btn-primary">Assign</a>

The view function :

def assign_recommended_project(request, group_id, client_id, project_id):
    group = StudentGroup.objects.get(id=group_id)
    group.client = client_id
    group.project = project_id
    group.save()
    project = Project.objects.get(id=project_id)
    project.is_assigned = True
    project.save()
    return redirect("coordinator_view_groups")

The url of the view function :

 path(
        "coordinator/assign_recommended_project/<str:group_id/str:client_id/str:project_id",
        assign_recommended_project,
        name="coordinator_assign_project_recommendations",
    ),

This is the error that is shown :

error

Can someone please help me solve this. Thanks.



Solution 1:[1]

path(
        "coordinator/assign_recommended_project/<str:group_id>/<str:client_id>/<str:project_id>",
        assign_recommended_project,
        name="coordinator_assign_project_recommendations",
    )

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohammad sadegh borouny