python - Using @login_required without "?next=/" appended to the URL -
i'm using @login_required decorator in such way:
@login_required(login_url=reverse_lazy('login')) def my_view: now know specify login url in settings, that's not question. thing after redirects 'login' url, appends ?next= it, so:
http://whatever.com/login/?next=/fakeurl/ i don't want it. there way override this? thanks.
you can pass additional parameter redirect_field_name=none login_required decorator.
@login_required(login_url=reverse_lazy('login'), redirect_field_name=none) def my_view(request): ... this remove ?next= portion in url.
Comments
Post a Comment