{% extends "base.html" %}
{% load crispy_forms_tags %}

{% block title%}
Login TweetMe
{% endblock title %}
{% block content %}
<br>
<h1 class="text-center">Login Tweet ME</h1>
<br>
<div class="row">
<div class="col-sm-6 col-sm-offset-3 text-center">
{% 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 %}

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

<button type="submit" class="btn btn-primary">Login</button>
<input type="hidden" name="next" value="{{ next }}">

</form>
<br>
{# Assumes you setup the password_reset view in your URLconf #}
</div></div>
{% endblock %}