I am using django auth views for authentication but after successful login it should try to redirect the user to the next GET param but it is redirecting to LOGIN_REDIRECT_URL only! here is my url
url(r'^login/$', auth_views.login, {'template_name': 'accounts/registered/login.html',}, name='login'),
in my setting.py
LOGIN_REDIRECT_URL = '/'
when a unauthenticated user wants to visit dashboard it automatically redirected to login page with next param
http://127.0.0.1:8000/accounts/login/?next=/accounts/dashboard/
but after successful login it redirects it to
http://127.0.0.1:8000/
it should redirect it according to next param.
Looks like you forgot to add hidden field next
to the accounts/registered/login.html
template:
<input type="hidden" name="next" value="{{ next }}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With