Thanks guys,

I didn't fully understand the meaning of "redirect_field_name".

@login_required() on it's own works as expected.

Paddy

On Sep 30, 3:19 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 9/29/07, Paddy Joy <[EMAIL PROTECTED]> wrote:
>
> > views.py
> > @login_required(redirect_field_name='/login/')
> > def index(request)
>
> You're using the 'redirect_field_name' argument incorrectly.
>
> The default value is 'next', which means Django will expect something like 
> this:
>
> http://yoursite.com/accounts/login/?next=/some_auth_required_page/
>
> But when you change the value of 'redirect_field_name', you're
> changing the name of the *variable* Django looks for; in other words,
> you're changing the '?next' bit, not the '/some_auth_required_page/'
> bit. So if you pass 'redirect_field_name="foo"', for example, Django
> will look for something like
>
> http://yoursite.com/accounts/login/?foo=/some_auth_required_page/
>
> And NOT something like
>
> http://yoursite.com/accounts/login/?next=foo
>
> See the documentation for details:
>
> http://www.djangoproject.com/documentation/authentication/#the-login-...
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."


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