Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skyler #3

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions challenge/templates/challenge3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends 'layout.html' %}

{% block content %}
<h1>Challenge 3</h1>
<p>This is an example using a flask method view to render a template</p>
{% endblock %}
1 change: 1 addition & 0 deletions challenge/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ <h2>Challenges</h2>
<ul>
<li><a href="/1/">Example Challenge 1</a></li>
<li><a href="/2/">Example Challenge 2</a></li>
<li><a href="/3/">Example Challenge 3</a></li>
</ul>
</div>
{% endblock %}
1 change: 1 addition & 0 deletions challenge/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from . import (
challenge_1, # noqa: F401
challenge_2, # noqa: F401
challenge_3, # noqa: F401
)


Expand Down
8 changes: 8 additions & 0 deletions challenge/views/challenge_3.py
Original file line number Diff line number Diff line change
@@ -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")
Loading