{% extends 'base.html' %}
{% block navbar %}{% endblock %}

{% block content %}
    <form class="form-signin" action="{% url 'login' %}" method="POST">
        {% csrf_token %}
        <h2 class="form-signin-heading">Login</h2>

        <label for="id_username" class="sr-only">Username</label>
        <input type="text" placeholder="Username" name="username" id="id_username" class="form-control" required autofocus>

        <label for="id_password" class="sr-only">Password</label>
        <input type="password" placeholder="Password" name="password" id="id_password" class="form-control">

        <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
    </form>
{% endblock %}

{% extends 'base.html' %}
{% block navbar %}{% endblock %}

{% block content %}
    <form class="form-signin" action="{% url 'login' %}" method="POST">
        {% csrf_token %}

        <input type="hidden" id="id_next" name="next" value="{{ request.GET.next }}">

        <h2 class="form-signin-heading">Login</h2>

        <label for="id_username" class="sr-only">Username</label>
        <input type="text" placeholder="Username" name="username" id="id_username" class="form-control" required autofocus>

        <label for="id_password" class="sr-only">Password</label>
        <input type="password" placeholder="Password" name="password" id="id_password" class="form-control">

        <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>
    </form>
{% endblock %}

Add hidden next input field for redirecting to next page
Add hidden next input field for redirecting to next page
