Saturday, December 16, 2017

No Reverse Match Exception

I am using the django generic UpdateView

class UserUpdate(UpdateView):
    model = User
    fields = ['first_name', 'last_name', 'email', 'username']
    template_name = 'Core\MyUpdate.htm'

And my url pattern is this:

url(r'^UpdateMe/(?P<pk>\d+)/$', UserUpdate.as_view(), name='Update')

However, this url  Core/UpdateMe/34/ doesnt seem to match and it gives this error

NoReverseMatch at /Core/UpdateMe/34/

Reverse for 'Update' with arguments '('',)' not found. 1 pattern(s) tried: ['Core/UpdateMe/(?P<pk>\\d+)/$']


--
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/53dc7230-00ec-45ae-b6d8-da9a135e04fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment