init push

This commit is contained in:
zachary62
2025-04-04 13:19:24 -04:00
parent fd99e416ab
commit d32ff1c6a4

View File

@@ -302,11 +302,13 @@ The key players are the `Flask` application instance (which holds the Jinja2 env
Templating is a fundamental technique for building dynamic web pages. Flask integrates seamlessly with the powerful Jinja2 template engine. Templating is a fundamental technique for building dynamic web pages. Flask integrates seamlessly with the powerful Jinja2 template engine.
{% raw %}
* We learned that templating separates HTML structure from Python logic. * We learned that templating separates HTML structure from Python logic.
* Flask looks for templates in a `templates` folder by default. * Flask looks for templates in a `templates` folder by default.
* The `render_template()` function is used to load a template file and pass data (context variables) to it. * The `render_template()` function is used to load a template file and pass data (context variables) to it.
* Jinja2 templates use `{{ variable }}` to display data and `{% statement %}` for control flow (like `if` and `for`). * Jinja2 templates use `{{ variable }}` to display data and `{% statement %}` for control flow (like `if` and `for`).
* The `url_for()` function is available in templates for generating URLs dynamically. * The `url_for()` function is available in templates for generating URLs dynamically.
{% endraw %}
Now you can create clean, maintainable HTML pages driven by your Flask application's data and logic. Now you can create clean, maintainable HTML pages driven by your Flask application's data and logic.