From b0567592adaacb7f9db3bf1ceeccd7559bf73fd1 Mon Sep 17 00:00:00 2001 From: Verox Date: Tue, 9 Jan 2024 17:52:13 +0100 Subject: [PATCH] Init simple Flask project --- .idea/.gitignore | 8 ++++++++ .idea/misc.xml | 9 +++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ HabitTracker.iml | 9 +++++++++ app.py | 16 ++++++++++++++++ templates/index.html | 7 +++++++ templates/layouts/main.html | 25 +++++++++++++++++++++++++ 8 files changed, 88 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 HabitTracker.iml create mode 100644 app.py create mode 100644 templates/index.html create mode 100644 templates/layouts/main.html diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3db0dcb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5a9dad8 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HabitTracker.iml b/HabitTracker.iml new file mode 100644 index 0000000..2b79f39 --- /dev/null +++ b/HabitTracker.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..0cf7364 --- /dev/null +++ b/app.py @@ -0,0 +1,16 @@ +from flask import Flask, render_template + +# Create a new Flask instance +app = Flask(__name__) + + +# Create a new route +@app.route('/') +def index(): + # return 'Hello World' + return render_template('index.html', title='Home') + + +# Run the application +if __name__ == '__main__': + app.run(port=5000, debug=True) diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..adf9335 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,7 @@ +{% extends 'layouts/main.html' %} + +{% block content %} +

Hello World!

+

Welcome to FlaskApp!

+

{{ utc_dt }}

+{% endblock %} \ No newline at end of file diff --git a/templates/layouts/main.html b/templates/layouts/main.html new file mode 100644 index 0000000..4235273 --- /dev/null +++ b/templates/layouts/main.html @@ -0,0 +1,25 @@ + + + + + {{ title }} - HabitTracker + + + + +
+
+ {% block content %} {% endblock %} +
+ + \ No newline at end of file