[Fixed]-Uniqueidentifier as argument in url | django

1πŸ‘

βœ…

In your urlpattern extraction_edit you have one keyword argument pk. But you did not specify it in your template.
Instead of

<a href="{% url 'crud:extraction_edit' extraction.id_extraction %}">edit</a>

rewrite href attribute like this:

<a href="{% url 'crud:extraction_edit' pk=extraction.id_extraction %}">edit</a>

Quote from Django doc:

The keyword arguments are made up of any named groups matched by the regular expression, overridden by any arguments specified in the optional kwargs argument to django.conf.urls.url().

Leave a comment