diff --git a/htmx_contact/app.py b/htmx_contact/app.py index 10588e0..e102ecf 100644 --- a/htmx_contact/app.py +++ b/htmx_contact/app.py @@ -1,5 +1,6 @@ from flask import Flask from flask import redirect +from flask import render_template app = Flask("htmx_contact") @@ -11,4 +12,4 @@ def index(): @app.route("/contacts", methods=["GET"]) def contacts(): - return "Hello HTMX" + return render_template("contacts.html", message="Hello HTMX") diff --git a/htmx_contact/templates/base.html b/htmx_contact/templates/base.html new file mode 100644 index 0000000..1a50a49 --- /dev/null +++ b/htmx_contact/templates/base.html @@ -0,0 +1,14 @@ + + + + + + {% block title %}{% endblock %} + + +{% block content %} +{% endblock %} +{% block scripts %} +{% endblock %} + + diff --git a/htmx_contact/templates/contacts.html b/htmx_contact/templates/contacts.html new file mode 100644 index 0000000..89a0d14 --- /dev/null +++ b/htmx_contact/templates/contacts.html @@ -0,0 +1,5 @@ +{% extends 'base.html' %} + +{% block content %} +

{{ message }}

+{% endblock %} diff --git a/scripts/run_lint_checks.sh b/scripts/run_lint_checks.sh index ae1d533..39f1828 100755 --- a/scripts/run_lint_checks.sh +++ b/scripts/run_lint_checks.sh @@ -1,5 +1,5 @@ #! /usr/bin/env bash -set -exu +set -ex # shellcheck source=/dev/null source "$(dirname "$0")/_common.sh" diff --git a/scripts/run_unit_tests.sh b/scripts/run_unit_tests.sh index 7ca34c3..b56ba6f 100755 --- a/scripts/run_unit_tests.sh +++ b/scripts/run_unit_tests.sh @@ -9,4 +9,4 @@ if [ "${DRONE}" == "true" ]; then pip install -r requirements.txt -r dev-requirements.txt fi -exec "${VIRTUAL_ENV}/bin/python" -m pytest -vv --cov "$@" +exec "${VIRTUAL_ENV:-}/bin/python" -m pytest -vv --cov "$@"