On Sep 7, 6:18 pm, felix <[EMAIL PROTECTED]> wrote:
> This should be dirt simple, but isn't working:
>
> main urls.py :
>  (r'^comments/(.*)', include('django.contrib.comments.urls')),
>
> comments.urls.py :
>
> urlpatterns = patterns('django.contrib.comments.views',
>     url(r'^post/$',          'comments.post_comment',
> name='comments-post-comment'),
>   etc.
>
> in the shell:
>
> >>> from django.core.urlresolvers import reverse
>
> # neither by the function>>> 
> reverse("django.contrib.comments.views.comments.post_comment")
>
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/urlresolvers.py", line 252, in
> reverse
>     *args, **kwargs)))
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/urlresolvers.py", line 241, in
> reverse
>     "arguments '%s' not found." % (lookup_view, args, kwargs))
> NoReverseMatch: Reverse for '<function post_comment at 0x14e2ab0>'
> with arguments '()' and keyword arguments '{}' not found.
>
> # nor by named URL>>> reverse('comments-post-comment')
>
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/urlresolvers.py", line 252, in
> reverse
>     *args, **kwargs)))
>   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/site-packages/django/core/urlresolvers.py", line 241, in
> reverse
>     "arguments '%s' not found." % (lookup_view, args, kwargs))
> NoReverseMatch: Reverse for 'comments-post-comment' with arguments
> '()' and keyword arguments '{}' not found.
>
> by copying and pasting the comments/urls directly into my site's URLs,
> the lookups work correctly.
>
> today's update, django svn trunk
> Revision: 8977


Here's what I get when I try out with the auth views:

In [1]: from django.core.urlresolvers import reverse

In [2]: reverse('django.contrib.auth.views.login')
---------------------------------------------------------------------------
NoReverseMatch                            Traceback (most recent call
last)

/home/theju/aaa/<ipython console> in <module>()

/home/theju/trunk/django/core/urlresolvers.py in reverse(viewname,
urlconf, args, kwargs, prefix)
    250         prefix = get_script_prefix()
    251     return iri_to_uri(u'%s%s' % (prefix,
get_resolver(urlconf).reverse(viewname,
--> 252             *args, **kwargs)))
    253
    254 def clear_url_caches():

/home/theju/trunk/django/core/urlresolvers.py in reverse(self,
lookup_view, *args, **kwargs)
    239                 return candidate
    240         raise NoReverseMatch("Reverse for '%s' with arguments
'%s' and keyword "
--> 241                 "arguments '%s' not found." % (lookup_view,
args, kwargs))
    242
    243 def resolve(path, urlconf=None):

NoReverseMatch: Reverse for '<function login at 0x96da8ec>' with
arguments '()' and keyword arguments '{}' not found.

In [3]:

So does it mean the admin doesn't work :)

This is a bug with urlresolvers and will get solved very soon.

--
Cheers
Thejaswi Puthraya
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to