From f3202c723519edce16781b296ef2396cd6c34ca3 Mon Sep 17 00:00:00 2001 From: patha Date: Sat, 13 Jan 2024 15:50:10 +0100 Subject: [PATCH] =?UTF-8?q?Bootstrap=20eingef=C3=BCgt,=20Buttons=20ausprob?= =?UTF-8?q?iert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 6 +++--- templates/base.html | 22 ++++++++++++++++++++++ templates/index.html | 16 +++------------- 3 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 templates/base.html diff --git a/app.py b/app.py index e1c384b..0a8dd74 100644 --- a/app.py +++ b/app.py @@ -1,11 +1,11 @@ -from flask import Flask, redirect, url_for, render_template +from flask import Flask, render_template app = Flask(__name__) @app.route('/') def home(): - return render_template('index.html', content=5) + return render_template('index.html') if __name__ == '__main__': - app.run() \ No newline at end of file + app.run(debug=True) \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..bc91076 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,22 @@ + + + + {% block title %}{% endblock %} + + +

Homepage

+ + + + + + + + + + + + {% block content %}{% endblock %} + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 3bc4981..27f0922 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,13 +1,3 @@ - - - Homepage - - -

Homepage

- {% for x in range(content) %} -

{{x}}

- {% endfor %} -

{{x}}

- - - \ No newline at end of file +{% extends "base.html" %} +{% block title %}Homepage{% endblock %} +{% block content %}

Test

{% endblock %} \ No newline at end of file