New user login/logoff system using standard Dj

This commit is contained in:
Philip Sargent
2021-04-06 00:49:09 +01:00
parent 6d6bec35f2
commit d1cd72c5f8
25 changed files with 348 additions and 197 deletions

View File

@@ -0,0 +1,53 @@
{% extends 'base.html' %}
{% block content %}
<!-- To understand how this all works, with invisible default behaviour, see
troggle/templates/login/logout.html
troggle/templates/registration/
because magic
This is because Django is Opinionated and does lots of Invisible Defaults
-->
<div class='middle'>
<h2>Troggle user login</h2>
</div>
{% if message %}
<div style='width: 350px;' class='middle3 login'>
{% if title %}
<div class='align-center'>
<h3>{{title}}</h3>
<div class='space'></div>
{% endif %}
<p>{{message }}</p>
</div>
{% endif %}
<h3>Troggle ordinary user login - no access to Django control panel</h3>
<p>(This is using template login/index.html)
<div style='width: 250px;' class='middle3 login'>
<div class='align-center'>
<div class='space'></div>
{% if invalid %}
<p class='error'>The username and password you provided don't match. Please try again.</p>
<p>Have you <a href='/accounts/forgottenpassword/'>forgotten your password</a>?<br/>
Or perhaps <a href='/accounts/forgottenusername/'>your username</a>?</p>
<p>Neither of those links work yet, by the way, I'm only trying to *appear* helpful.
<div class='space'></div>
{% endif %}
<div class='align-center'>
<form action="" method="post" accept-charset="utf-8">{% csrf_token %}
<table class='form'>
<tr><th><label for="id_username">Username:</label></th><td><input id="id_username" type="text" name="username" maxlength="30" /></td></tr>
<tr><th><label for="id_password">Password:</label></th><td><input type="password" name="password" id="id_password" /></td></tr>
</table>
<div class='space'></div>
<br/>
<p><input type="submit" value="Login &rarr;"></p>
</form>
</div>
{% endblock %}