diff --git a/README.md b/README.md index f1d0396..50fe859 100644 --- a/README.md +++ b/README.md @@ -8,22 +8,22 @@ This template repository contains all the required files to start a simple chall Ensure you have python poetry installed - this is used to install a virtualenv and manage dependencies ``` -pip install --upgrade pip -pip3 install -u poetry -poetry install --no-root +pip install --upgrade pip --user +pip3 install poetry +python -m poetry install --no-root ``` ## Running in development Flask comes with a development server built in. To use it, run ``` -poetry run flask -A challenge run +python -m poetry run flask -A challenge run ``` ## Running in production ``` -poetry run gunicorn 'challenge:app' +python -m poetry run gunicorn 'challenge:app' ``` ## Running with docker diff --git a/challenge/templates/challenge3.html b/challenge/templates/challenge3.html new file mode 100644 index 0000000..6fa1609 --- /dev/null +++ b/challenge/templates/challenge3.html @@ -0,0 +1,6 @@ +{% extends 'layout.html' %} + +{% block content %} +

Challenge 3

+

This is an example using a flask method view to render a template

+{% endblock %} diff --git a/challenge/templates/index.html b/challenge/templates/index.html index ff887f4..b967fc9 100644 --- a/challenge/templates/index.html +++ b/challenge/templates/index.html @@ -8,6 +8,7 @@

Challenges

{% endblock %} diff --git a/challenge/views/__init__.py b/challenge/views/__init__.py index 37c9efc..40a02e6 100644 --- a/challenge/views/__init__.py +++ b/challenge/views/__init__.py @@ -5,6 +5,7 @@ from . import ( challenge_1, # noqa: F401 challenge_2, # noqa: F401 + challenge_3, # noqa: F401 ) diff --git a/challenge/views/challenge_3.py b/challenge/views/challenge_3.py new file mode 100644 index 0000000..d179a9d --- /dev/null +++ b/challenge/views/challenge_3.py @@ -0,0 +1,8 @@ +from flask import render_template + +from challenge import app + + +@app.route("/3/", methods=["GET", "POST"]) +def challenge_3() -> str: + return render_template("challenge3.html")