>
> In [1]: from django.core.urlresolvers import reverse
>
> In [2]: reverse("login")
> ---------------------------------------------------------------------------
> NoReverseMatch                            Traceback (most recent call last)
>
> /Users/tunix/Projects/raptiye/raptiye/<ipython console> in <module>()
>
> /Users/tunix/Projects/django/core/urlresolvers.pyc in reverse(viewname,
> urlconf, args, kwargs, prefix, current_app)
>     354
>     355     return iri_to_uri(u'%s%s' % (prefix, resolver.reverse(view,
> --> 356             *args, **kwargs)))
>     357
>     358 def clear_url_caches():
>
> /Users/tunix/Projects/django/core/urlresolvers.pyc in reverse(self,
> lookup_view, *args, **kwargs)
>     300             lookup_view_s = lookup_view
>     301         raise NoReverseMatch("Reverse for '%s' with arguments '%s'
> and keyword "
> --> 302                 "arguments '%s' not found." % (lookup_view_s, args,
> kwargs))
>     303
>     304 def resolve(path, urlconf=None):
>
> NoReverseMatch: Reverse for 'login' with arguments '()' and keyword
> arguments '{}' not found.
>
> In [3]:
>

Nope, it doesn't work too.. Besides, that's the login in users app. I need
to refer to django's auth app's login view by using its path like:

reverse("django.contrib.auth.views.login")

because some other part of the code that also uses this method with some
other view doesn't work. Therefore I really need to solve this.

---
Quis custodiet ipsos custodes?


2010/5/2 ofri <ofri.ra...@gmail.com>

> Did you try:
> reverse("login")
> ?
>
> when you define this url, you're using
> patterns('django.contrib.auth.views',
>    url(r'^login/$', 'login', {
>        'template_name': 'login.html'
>    }, name='login'),
> the last parameter names it 'login'
>
> On 2 מאי, 16:10, Alper KANAT <tu...@raptiye.org> wrote:
> > Hey There,
> >
> > I'm stuck here for almost 1 week so really appreciate any help. What I'm
> > trying to do is to get the reverse URL for login view for example. So I
> do
> > the following:
> >
> > In [1]: from django.core.urlresolvers import reverse
> >
> >
> >
> >
> >
> > > In [2]: reverse("django.contrib.auth.views.login")
> > >
> ---------------------------------------------------------------------------
> > > NoReverseMatch                            Traceback (most recent call
> last)
> >
> > > /Users/tunix/Projects/raptiye/raptiye/<ipython console> in <module>()
> >
> > > /Users/tunix/Projects/django/core/urlresolvers.pyc in reverse(viewname,
> > > urlconf, args, kwargs, prefix, current_app)
> > >     354
> > >     355     return iri_to_uri(u'%s%s' % (prefix, resolver.reverse(view,
> > > --> 356             *args, **kwargs)))
> > >     357
> > >     358 def clear_url_caches():
> >
> > > /Users/tunix/Projects/django/core/urlresolvers.pyc in reverse(self,
> > > lookup_view, *args, **kwargs)
> > >     300             lookup_view_s = lookup_view
> > >     301         raise NoReverseMatch("Reverse for '%s' with arguments
> '%s'
> > > and keyword "
> > > --> 302                 "arguments '%s' not found." % (lookup_view_s,
> args,
> > > kwargs))
> > >     303
> > >     304 def resolve(path, urlconf=None):
> >
> > > NoReverseMatch: Reverse for 'django.contrib.auth.views.login' with
> > > arguments '()' and keyword arguments '{}' not found.
> >
> > > In [3]:
> >
> > For some other django apps that I'm working on, this works without any
> > problems. I compared their settings.py and urls.py but still no luck. For
> > any help, I'm pasting settings.py to [1] and urls.py to [2].
> >
> > [1]http://pastie.textmate.org/private/npbxwbqldumbyfznkg0avw
> > [2]http://pastie.textmate.org/private/22e8zrnojygal51gilxla
> >
> > Thanks!
> >
> > ---
> > Quis custodiet ipsos custodes?
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> > For more options, visit this group athttp://
> groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to