>
> lire.html
> ...
>   <button onclick="location.href='{% url 'modification' req.id %}'"
> type="button">Editer la<br />requĂȘte</button>
> ...
>
> urls.py
> path('edit/<int:id>', views.view_modif, name='modification'),
> error :
> NoReverseMatch at /edit/1
>
> Reverse for 'modification' with no arguments not found. 1 pattern(s) tried: 
> ['edit/(?P<id>[0-9]+)$']
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/edit/1
> Django Version: 2.0
> Exception Type: NoReverseMatch
> Exception Value:
>
> Reverse for 'modification' with no arguments not found. 1 pattern(s) tried: 
> ['edit/(?P<id>[0-9]+)$']
>
> Exception Location: /usr/lib/python3.7/site-packages/django/urls/resolvers.py
> in _reverse_with_prefix, line 632
> Python Executable: /usr/bin/python
>



The error is saying you have no arguments to the {% url %} tag. Make sure
that req.id is actually resolving to an integer value.

Templates are fun when they mask missing values like that. You already have
it displayed earlier in the template. Comment out the {% url %} tag and see
if a number is displayed in your template.

-James

>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWV4K7%2BvTb8q8sGQBnbsY9t4srQK%2BH_NSZMCKSNp6KnAA%40mail.gmail.com.

Reply via email to