Sunday, December 17, 2017

Re: No Reverse Match Exception




<a href="{% url 'Update' pk=User.id %}">Update</a>

It gives the No Reverse Error. I dont seem to understand why

Instead of User.id, try user.id, capitalization matters.

Trying not to confuse things, but in this instance you may instead want to use object.id, since you may be referring to a different User object than the one that is logged in. I made an assumption that the view will be only modifying the logged in user.

-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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWcjSo3%3DXOPLopKxo5r2qqwZ3pE_97gGpJV4q5gGNELCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment