From 7279d65859b20cacf672d73abe2770a34abfd587 Mon Sep 17 00:00:00 2001 From: Daniel Maclaren Date: Sun, 3 Mar 2024 20:12:33 +0000 Subject: [PATCH] added flask, reformatted from a html/css site --- app.py | 11 +++++++++++ requirements.txt | 1 + templates/index.html | 10 ++++++++++ index.html => templates/layout.html | 10 ++++++---- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 app.py create mode 100644 requirements.txt create mode 100644 templates/index.html rename index.html => templates/layout.html (84%) diff --git a/app.py b/app.py new file mode 100644 index 0000000..df1c201 --- /dev/null +++ b/app.py @@ -0,0 +1,11 @@ +from flask import Flask, render_template, request + +app = Flask(__name__) + + +@app.route("/") +def home(): + return render_template("index.html") + + if __name__ == "__main__": + app.run(debug=True) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2077213 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Flask \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..a7ed9ca --- /dev/null +++ b/templates/index.html @@ -0,0 +1,10 @@ +{% extends "layout.html" %} + +{% block title %} + Index +{% endblock %} + +{% block main %} +

Test

+ +{% endblock %} \ No newline at end of file diff --git a/index.html b/templates/layout.html similarity index 84% rename from index.html rename to templates/layout.html index b165d81..852aac9 100644 --- a/index.html +++ b/templates/layout.html @@ -1,16 +1,18 @@ - - + + - - Bootstrap demo + + {% block content %}{% endblock %}

Hello, world!

+ {% block main %} + {% endblock %} \ No newline at end of file