-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoginView not using success_url #17
Comments
Using this SO answer I was able to work around the issue by including a hidden form element with
|
The redirection really happens based on the I think that hidden input field and |
To give my background story here: the reason I ran into this issue is that I want a redirect specifically to the index of the app the user was logging in at, so not the root of the project, meaning a global setting won't help me. On a more general note I would expect it to default to the current page the user clicked the Log in button, like how most websites behave. Although most of them use an intermediate page, like Github here or Amazon for example, they then redirect to the previous page, not the root index. Checking the Django docs on LoginView it seems that the class property
And indeed providing success_url via that dict in the LoginView
and using success_url manually as the hidden form element's value
Works fine, so at least in that way the redirection value can be statically defined in the view again. |
@bastiaan85 That's great way for custom success_url. I'll update the README.rst. Thanks for great contribution. |
I'm not sure if this is a clone of #2 or #3 but I can't get the CustomLoginView success_url property to work to redirect after a login. Adding debug prints to the code using your example Django project, it seems the actual redirection is performed using the hard coded
LOGIN_REDIRECT_URL = '/'
in thesettings.py
. Setting the success_url to any value has no effect on this process.Also the current version 1.3.1 of the
jquery.bootstrap.modal.forms.js
seems to lack the successURL competely while the previous versions still processed it. Does this mean the feature is currently broken or am I missing something?The text was updated successfully, but these errors were encountered: