Skip to content

Commit 82a620a

Browse files
committed
Mild refactor.
1 parent e8c4652 commit 82a620a

File tree

14 files changed

+182
-100
lines changed

14 files changed

+182
-100
lines changed

.idea/flask-jinja-tutorial.iml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pipfile.lock

Lines changed: 17 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Flask Jinja Tutorial
22

3-
![Python](https://img.shields.io/badge/Python-v3.7-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
3+
![Python](https://img.shields.io/badge/Python-v3.8-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
44
![Flask](https://img.shields.io/badge/Flask-v1.1.1-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
55
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c&logo=GitHub)
66
[![GitHub Issues](https://img.shields.io/github/issues/hackersandslackers/flask-jinja-tutorial.svg?style=flat-square&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-jinja-tutorial/issues)
@@ -11,19 +11,20 @@
1111

1212
Source code for the accompanying tutorial found here: https://hackersandslackers.com/flask-page-templates-jinja/
1313

14-
## Getting Started
14+
## Installation
1515

16-
Installation is recommended with Poetry:
16+
**Installation via `requirements.txt`**:
1717

1818
```shell
1919
$ git clone https://github.com/hackersandslackers/flask-jinja-tutorial.git
2020
$ cd flask-jinja-tutorial
21-
$ poetry shell
22-
$ poetry install
23-
$ poetry run
21+
$ python3 -m venv myenv
22+
$ source myenv/bin/activate
23+
$ pip3 install -r requirements.txt
24+
$ flask run
2425
```
2526

26-
With Pipenv:
27+
**Installation via [Pipenv](https://pipenv-fork.readthedocs.io/en/latest/)**:
2728

2829
```shell
2930
$ git clone https://github.com/hackersandslackers/flask-jinja-tutorial.git
@@ -33,14 +34,15 @@ $ pipenv update
3334
$ flask run
3435
```
3536

36-
Alternatively, try installing via `setup.py`:
37+
**Installation via [Poetry](https://python-poetry.org/)**:
3738

3839
```shell
3940
$ git clone https://github.com/hackersandslackers/flask-jinja-tutorial.git
4041
$ cd flask-jinja-tutorial
41-
$ python3 setup.py install
42-
$ flask run
42+
$ poetry shell
43+
$ poetry update
44+
$ poetry run
4345
```
4446
-----
4547

46-
**Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.
48+
**Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.

flask_jinja_tutorial/routes.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55

66
@app.route('/')
77
def home():
8-
"""Landing page."""
9-
nav = [{'name': 'Home', 'url': 'https://example.com/1'},
10-
{'name': 'About', 'url': 'https://example.com/2'},
11-
{'name': 'Pics', 'url': 'https://example.com/3'}]
12-
return render_template('home.html',
13-
nav=nav,
14-
title="Jinja Demo Site",
15-
description="Smarter page templates \
16-
with Flask & Jinja.")
8+
"""App landing page."""
9+
nav = [
10+
{'name': 'Home', 'url': 'https://example.com/1'},
11+
{'name': 'About', 'url': 'https://example.com/2'},
12+
{'name': 'Pics', 'url': 'https://example.com/3'}
13+
]
14+
return render_template(
15+
'home.html',
16+
nav=nav,
17+
title="Jinja Demo Site",
18+
description="Smarter page templates with Flask & Jinja."
19+
)

flask_jinja_tutorial/static/css/home.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ nav a {
1313
margin-right: 30px;
1414
color: #597a96;
1515
text-decoration: none;
16-
17-
1816
}
1917

2018
.container {

0 commit comments

Comments
 (0)