From a1ee5f3ea0cafcbe15ebbf92c072b897e462160d Mon Sep 17 00:00:00 2001 From: patha Date: Sat, 13 Jan 2024 16:19:52 +0100 Subject: [PATCH] =?UTF-8?q?Form.html=20gebaut,=20Bl=C3=B6cke=20ausgelagert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 4 ++++ templates/base.html | 18 +++--------------- templates/form.html | 18 ++++++++++++++++++ templates/index.html | 10 ++++++++-- 4 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 templates/form.html diff --git a/app.py b/app.py index 0a8dd74..6000a18 100644 --- a/app.py +++ b/app.py @@ -6,6 +6,10 @@ app = Flask(__name__) def home(): return render_template('index.html') +@app.route ('/form', methods=['GET','POST']) +def form(): + return render_template('form.html') + if __name__ == '__main__': app.run(debug=True) \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index bc91076..cc5ba51 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,21 +1,9 @@ - - - {% block title %}{% endblock %} + + + {% block title %}{% endblock %} -

Homepage

- - - - - - - - - - - {% block content %}{% endblock %} diff --git a/templates/form.html b/templates/form.html new file mode 100644 index 0000000..9a61b76 --- /dev/null +++ b/templates/form.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %} + Title: Form +{% endblock %} + +{% block content %} + + + + + + + + + + +{% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 27f0922..e33e434 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,9 @@ {% extends "base.html" %} -{% block title %}Homepage{% endblock %} -{% block content %}

Test

{% endblock %} \ No newline at end of file + +{% block title %} + Title: Index +{% endblock %} + +{% block content %} + Content: Index +{% endblock %} \ No newline at end of file