How would one set next from a view with the code i showed above?

I think I understand what you're asking.  If you sent next as a hidden
variable in your template, you get read it by calling:
request.REQUEST.get as seen here:
http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/views.py
(line 14)

How can i have login_required link to another page than accounts/login?

You can create and use your own login_required decorator using the
"user_passes_test" method in django.contrib.auth.decorators.  The
default login_required decorator is simply this:
   login_required = user_passes_test(lambda u: u.is_authenticated())

user_passes_test takes a 2nd argument of a login_url to redirect to if
the test fails.  You'd provide this...
   my_login_required = user_passes_test(lambda u:
u.is_authenticated(), '/mylogin/')

Then decorate your view with your own decorator.

However, if you continue to use some of the contrib.auth views, some
things start to get harder to override.  I experienced this with the
password_change view which uses the default django login_required
decorator.  See this thread:
http://groups.google.com/group/django-developers/browse_thread/thread/3f05e187ace7c8bb/b23d355d1cf20417?lnk=gst&q=next+login&rnum=1#b23d355d1cf20417

-Rob


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

Reply via email to