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..a82fdf6 --- /dev/null +++ b/challenge/views/challenge_3.py @@ -0,0 +1,8 @@ +from flask import render_template, views + +from challenge import app + + +@app.route("/3/", methods=["GET", "POST"]) +def challenge_3(): + return render_template("challenge3.html")