<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>
    {% if form.errors %}
    <p>There"s something wrong with what you have entered</p>
    {% endif %}

    {% if next %}
    <p>Hey,you cant access that page.</p>
    {% endif %}

    <form method="post" action="{% url 'login' %}">
        {% csrf_token %}

        <p>Username: {{ form.username }}</p>
        <p>Password: {{ form.password }}</p>

       <p> <input type="submit" value="login"></p>
        <input type="hidden" name="next" value="{{ next }}">


    </form>

</body>
</html>