Hi Alendit,

Thanks for explanation. I understand its not necessary but want to
understand how reverse() works-checked source but did not understand
much. my doubt is if I use something like :

reverse('django.contrib.auth.views.password_change_done'),

and have url entry like as follows.

 url(r'^change-password-done/$', 'profile.views.password_change_done',
name='django.contrib.auth.views.password_change_done'),

now I do not have any entry with "function string" with
'django.contrib.auth.views.password_change_done', but I have an entry
with name='django.contrib.auth.views.password_change_done', so django
should pick this. But it complains it can not find reverse for this.
It should either pick it from
django.contrib.auth.views.password_change_done or should pick the name
entry from my urlconf.

Is it because my name is separated with '.' ? Is there any such
constraints on the name entry or is it the problem because a view with
this name already exists in auth app.

Thanks for the help.


On Mar 27, 7:09 pm, Alendit <alen...@googlemail.com> wrote:
> Hi,
>
> if only one url is bound to a controller there is no need for a name
> argument. When you are specifying a name for an expression and it have
> got the same name as the controller a conflict arise. Just drop the
> name argument and it should work.
>
> Alendit.
>
> On 27 Mrz., 09:54, Ajay <ajayn...@gmail.com> wrote:
>
> > I am missing something really basic here.
>
> > I am trying to reuse django's change password views. I have following
> > in urls.py:
>
> > (r'^change-password/$', 'profile.views.change_password',
> > {},'change_password'),
> > url(r'^change-password-done/$', 'profile.views.password_change_done',
> > name='django.contrib.auth.views.password_change_done'),
>
> > and in corresponding views.py:
>
> > from django.contrib.auth.views import password_change,
> > password_change_done
>
> > def
> > change_password(request,template_name="password_change_form.html"):
> >     """Change Password"""
> >     return password_change(request,template_name=template_name)
>
> > def password_change_done(request,
> > template_name="password_change_done.html"):
> >     return render_to_response(template_name,(),context_instance=
> > RequestContext(request))
>
> > but I am getting following error:
>
> >     Reverse for 'django.contrib.auth.views.password_change_done' with
> > arguments '()' and keyword arguments '{}' not found.
>
> > looked at the source and saw this line:
>
> > post_change_redirect =
> > reverse('django.contrib.auth.views.password_change_done')
>
> > If I change my urls.py entry to following , I do not get the above
> > error:
>
> > url(r'^change-password-done/$',
> > 'django.contrib.auth.views.password_change_done', name='anything'),
>
> > but I am confused as reverse() should look-up using the "name"
> > parameter? What am I missing here?
>
> > I am using django 1.2.3

-- 
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 
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