The rendered page contains the root code of base.html and the fill-ins from the block of results.html. When you visit, you should notice no changes. You don’t need to adjust your results() view. Note that results.html doesn’t contain a title block.īut your page will still display the correct title, because it uses the fallback content in base.html and the view provides a title variable. ![]() from_string ( "Hello, tags.īy providing the block’s name as an argument, you’re connecting the blocks from the child template with the blocks from the parent template. You can also find the full source code of the web project by clicking on the link below: To see what it’ll do, skip ahead to the final section. Throughout the tutorial, you’ll build an example app that showcases some of Jinja’s wide range of features. Later you’ll build a basic Flask web project with two pages and a navigation bar to leverage the full potential of Jinja. You’ll start by using Jinja on its own to cover the basics of Jinja templating. Use macros to add functionality to your front end.Use for loops and conditional statements with Jinja.When you want to create text files with programmatic content, Jinja can help you out. ![]() ![]() With Jinja, you can build rich templates that power the front end of your Python web applications.īut you don’t need to use a web framework to experience the capabilities of Jinja. Templates are an essential ingredient in full-stack web development.
0 Comments
Leave a Reply. |