#4: add base template; extend base template in views

This commit is contained in:
Lexi / Zoe 2019-11-10 23:37:31 +01:00
parent fe7fce76c0
commit b7311f2308
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
7 changed files with 110 additions and 62 deletions

12
templates/base.html Normal file
View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>{% block title %}Tofu{% endblock %} - Tofu</title>
</head>
<body>
<h1>Tofu</h1>
{% block content %}No content.{% endblock %}
</body>
</html>

View file

@ -1,7 +1,13 @@
<h2>Login</h2>
{% extends "base.html" %}
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% block title %}Login{% endblock %}
{% block content %}
<h2>Login</h2>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock %}