The problem of form submission url under django

first log in to the ip:port/login interface
through form submission and execute the do_login function in view.py. If the login is unsuccessful, I want to jump to the original ip:port/login, and carry the error message.

if I return via rerener (request, "login.html", {" user_is_wrong":"no such user"}) , the url that jumps to the page is ip:port/login/do_login,. What should I do to make the page url be ip:port/login

<form class="form-horizontal" action="do_login/" method="POST">
            {% csrf_token %}
            <p class="form-actions">
                <div class="form-group">
                    username:<input type="id" class="form-control"  placeholder="id" name="id">
                </div>
                <div class="form-group">
                    password:<input type="password" class="form-control"  placeholder="password" name="password">
                </div>
                <input type="submit" value="login" class="btn btn-primary">
            

</form>
Mar.09,2021
What is

rerener?
you are the direct return render (.) Is that it?
if you want to jump to the page, use redirect ();


return HttpResponseRedirect ('/ port/login')

Menu