Hi all:
I have a URLconf url entry like this:
url(
regex=r'^(?P<category>\w+)/(?P<slug>[-\w]+)/$',
view='show_post',
name='show_post',
kwargs={'msg': None},
),
and I want to call it with HttpResponseRedirect and reverse():
filters = {'category': post.category.name, 'slug': post.slug}
return HttpResponseRedirect(reverse('show_post', kwargs=filters))
but I am getting this error:
NoReverseMatch at /commentposted/first-post/
Reverse for 'show_post' with arguments '()' and keyword arguments
'{'category': u'django', 'msg': 'Your comment has been posted',
'slug': u'first-post'}' not found.
Request Method: GET
Request URL: http://localhost:8000/commentposted/first-post/?c=8
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'show_post' with arguments '()' and keyword arguments
'{'category': u'django', 'msg': 'Your comment has been posted',
'slug': u'first-post'}' not found.
Is there any way to pass th reverse() function extra optional
parameters that the url define? Or am I crazy?
Thanks in advance!
Hector
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---