I want to create a homepage with a header that asks to login with username/password and a login button to login. Currently, how I have my page set up is that pressing login
Using Django 1.11. I had the same problem just now, here's what worked for me...
Import the login view class from the built in auth app and pass in your template file via the template_name kwarg.
In urls.py:
from django.contrib.auth.views import LoginView
app_name = 'yourapp'
urlpatterns = [
url(r'^$', LoginView.as_view(template_name='yourapp/index.html'), name="index"),
]
And in your view you can use the form variable to render out your form. In my case I use bootstrap so.
In index.html:
{% extends 'base.html' %}
{% loads bootstrap %}
{% block content %}
{% endblock content %}