Set up a Wagtail user login system

This document assumes that you have a Wagtail application up and running (see). It will take you through the steps that you need to follow to set up pages and links that will allow a registered user to login, log out and change their password.

To run this project I am using a menu page:

{% block content %}
Your are logged in as: 
<p></p>
<a href="">Logout</a>
<p></p>
<a href="">Login</a>
<p></p>
<a href="">Change password</a>
{% endblock %}
  1. Create a new app users

     ./manage.py startapp users
    
  2. Update base.py

     INSTALLED_APPS = [
         ...
         'users',
         ...
    
  3. In <project>/urls.py:

     urlpatterns = [
         ...
         url(r'^users/', include('users.urls')),
         ...
    
  4. In users/urls.py:

     from django.urls import path
    
     from . import views
    
     urlpatterns = [
             path(r'logout/', views.logout, name='logout'),
         ]
    

The logout screen

This is the simplest function to provide.