Redirect_field_name in LoginView

445 views
Skip to first unread message

Polina Ia

unread,
Jul 14, 2017, 7:13:29 AM7/14/17
to Django users
Hello, 
can someone explain me the setting of 'redirect_field_name' in LoginView?

in my urls.py I have the following 

urlpatterns = [
   url('^login/$', LoginView.as_view(template_name='accounts/login.html'), name='login'),
    ]

After successful signing in it redirects to default 'next'=/accounts/profile/. I'd like to redirect to my own url. Is it better to set 'next' value in view or 'redirect_field_name' in urls? I am not sure if they have similar purpose or not?

Tim Graham

unread,
Jul 14, 2017, 7:29:37 AM7/14/17
to Django users
Reply all
Reply to author
Forward
0 new messages