Template use

This commit is contained in:
Emily 2019-02-12 17:09:43 +01:00
parent 85b7aa60a3
commit 7838a838cc
3 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,7 @@
from flask import render_template, url_for
from objects import glob # Global sharing of python objects in a manageable way
@glob.app.route("/")
@glob.app.route("/home")
def home():
return render_template("home.html", title = "Home")

4
templates/home.html Normal file
View File

@ -0,0 +1,4 @@
{% extends "layout/main.html" %}
{% block content %}
<p>Template usage</p>
{% endblock %}

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
{% if title %}
<title>Husstanden - {{ title }}</title>
{% else %}
<title>Husstanden</title>
{% endif %}
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>