I love django's @login_required decorator, but there's one thing I can't figure out how to make it do.
If an unauthenticated user tries visits a @login_required page (e.g. "/private-stuff/"), I want to kick them back to the home page (e.g. "/home/"). But I don't want to append a "?next=" argument to the url. In other words, I just want to redirect to "/home/", not "/home/?next=/private-stuff/".
How can I do that? Is there a better way than just writing my own decorator?
Isn't it just simply as:
@decorators.login_required(redirect_field_name=None)
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