What HTML actually is
HTML is just labels. You wrap content in tags and the browser knows what to do with it. Every tag has an opening <tag> and a closing </tag>.
<h1>Spendly</h1>
→
Big bold heading
<p>Track your money</p>
→
A paragraph of text
<a href="/login">Login</a>
→
A clickable link to /login
Jinja2 — Flask's HTML superpower
Flask adds special syntax to your HTML. Two things to know:
{{ variable }}
→
Print a value from Python. e.g. {{ name }} becomes "Alex"
{% block content %}
{% endblock %}
→
A slot in base.html. Child pages fill this in.
{% extends "base.html" %}
→
First line in login.html, register.html. Inherits the layout.
{{ url_for('static',
filename='css/style.css') }}
→
The right way to link your CSS file in Flask.