login.html 1.71 KB
Newer Older
Jon Yu's avatar
Jon Yu committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% extends "base.html" %}

{% block content %}
    {% if form.errors %}
    <p>Your username and password didn't match. Please try again.</p>
    {% endif %}

    {% if next %}
        {% if user.is_authenticated %}
        <p>Your account doesn't have access to this page. To proceed,
        please login with an account that has access.</p>
        {% else %}
        <p>Please login to see this page.</p>
        {% endif %}
    {% endif %}

Jon Yu's avatar
Jon Yu committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    <div class="col-lg-6 offset-lg-3 my-4">
        <div class="card">
            <div class="card-body">
                <form method="post" action="{% url 'login' %}">
                    {% csrf_token %}
                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="username">Username</label>
                            <input class="form-control" type="text" placeholder="Username" autofocus autocapitalize="none" autocomplete="username" maxlength="150" required id="username">
                        </div>
                        <div class="form-group col-md-6">
                            <label for="password">Password</label>
                            <input class="form-control" type="password" placeholder="Password" autofocus autocomplete="current-password" required id="password">
                        </div>
Jon Yu's avatar
Jon Yu committed
31
                    </div>
Jon Yu's avatar
Jon Yu committed
32
33
34
35
36
37
38
                    <button type="submit" class="btn btn-primary">Login</button>
                    <input type="hidden" name="next" value="{{ next }}">
                </form>
            </div>
            <div class="card-footer">
                <a href="{% url 'password_reset' %}">Lost password?</a>
            </div>
Jon Yu's avatar
Jon Yu committed
39
40
41
        </div>
    </div>
{% endblock %}