Skip to content

Commit

Permalink
Merge pull request #3 from sotoncyber/skyler
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyler84 authored Mar 6, 2024
2 parents de4125f + 28bf49b commit d62553c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
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")

0 comments on commit d62553c

Please sign in to comment.