Template use
This commit is contained in:
parent
85b7aa60a3
commit
7838a838cc
|
@ -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
4
templates/home.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "layout/main.html" %}
|
||||
{% block content %}
|
||||
<p>Template usage</p>
|
||||
{% endblock %}
|
14
templates/layout/main.html
Normal file
14
templates/layout/main.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user