Reverse for 'Update' with arguments '('',)' not found. 1 pattern(s) tried: ['Core/UpdateMe/(?P<pk>\\d+)/$']
r'^/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...@googlegroups.com.
To post to this group, send email to django...@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/867231ed-4b2e-4882-87c5-d482579dc182%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The problem is that, it works perfectly when i put the number on the template like this<a href="{% url 'Update' 34 %}">Update</a>But when i do<a href="{% url 'Update' pk=User.id %}">Update</a>It gives the No Reverse Error. I dont seem to understand why
Yingi Kem
try fix your pattern to--r'^/Core/UpdateMe/(?P<pk>\\d+)/$'
суббота, 16 декабря 2017 г., 12:22:49 UTC+3 пользователь yingi keme написал:I am using the django generic UpdateViewclass UserUpdate(UpdateView):model = Userfields = ['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 errorNoReverseMatch 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...@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/867231ed-4b2e-4882-87c5-d482579dc182%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@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/249DD07C-736B-4861-A32B-2C00FC04E960%40gmail.com.
From this:
<a href="{% url 'Update' pk=User.id %}">Update</a>Change to this:
<a href="{% url 'Update' pk={{User.id}} %}">Update</a>
On 17-Dec-2017 2:00 PM, "yingi keme" <ying...@gmail.com> wrote:The problem is that, it works perfectly when i put the number on the template like this<a href="{% url 'Update' 34 %}">Update</a>But when i do<a href="{% url 'Update' pk=User.id %}">Update</a>It gives the No Reverse Error. I dont seem to understand why
Yingi Kemtry fix your pattern tor'^/Core/UpdateMe/(?P<pk>\\d+)/$'
суббота, 16 декабря 2017 г., 12:22:49 UTC+3 пользователь yingi keme написал:I am using the django generic UpdateViewclass UserUpdate(UpdateView):model = Userfields = ['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 errorNoReverseMatch 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...@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/867231ed-4b2e-4882-87c5-d482579dc182%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@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/249DD07C-736B-4861-A32B-2C00FC04E960%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@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/CAGGVXBPV1H%2BiT7gDb3DmDVOm%2B94i8wOr0KH%2BwEf97jGRfGFtmg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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/CAK4qSCf-uU8cMQrz1JBWkrEU9e4ny_jW%2BRU8z4zbD0s-0hvHbw%40mail.gmail.com.
The problem is that, it works perfectly when i put the number on the template like this<a href="{% url 'Update' 34 %}">Update</a>But when i do<a href="{% url 'Update' pk=User.id %}">Update</a>It gives the No Reverse Error. I dont seem to understand why
Reverse for 'Update' with arguments '('',)' not found. 1 pattern(s) tried: ['Core/UpdateMe/(?P<pk>\\d+)/$']
<a href="{% url 'Update' pk=User.id %}">Update</a>It gives the No Reverse Error. I dont seem to understand whyInstead of User.id, try user.id, capitalization matters.
--
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...@googlegroups.com.
To post to this group, send email to django...@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.