Reader small image

You're reading from  Building Web Applications with Flask

Product typeBook
Published inJun 2015
Reading LevelBeginner
Publisher
ISBN-139781784396152
Edition1st Edition
Languages
Tools
Right arrow
Authors (4):
Italo M Campelo Maia
Italo M Campelo Maia
author image
Italo M Campelo Maia

Italo Maia is a full-stack developer with 10 years of experience in creating software for the mobile, Web, and desktop environments, having dedicated most of the last few years to development with Python and web technologies. Author of Flask-Empty, a popular skeleton for Flask projects that aggregates good practices and recipes for quick prototyping, he is active in the Brazilian Python communities, having open source tools and libraries available in GitHub and Bitbucket.
Read more about Italo M Campelo Maia

Jack Stouffer
Jack Stouffer
author image
Jack Stouffer

Jack Stouffer is a programmer who has several years of experience in designing web applications. He switched to Flask three years ago for all his projects. He currently works for Apollo America in Auburn Hills, Michigan, and writes internal business tools and software using Python, Flask, and JavaScript. Jack is a believer and supporter of open source technology. When he released his Flask examples with the recommended best practices on GitHub (https://github.com/JackStouffer), it became one of the most popular Flask repositories on the site. Jack has also worked as a reviewer for Flask Framework Cookbook, Packt Publishing.
Read more about Jack Stouffer

Gareth Dwyer
Gareth Dwyer
author image
Gareth Dwyer

Gareth Dwyer hails from South Africa but now lives in Europe. He is a software engineer and author and is currently serving as the CTO at the largest coding education provider in Africa. Gareth is passionate about technology, education, and sharing knowledge through mentorship. He holds four university degrees in computer science and machine learning, with a specialization in natural language processing. He has worked with companies such as Amazon Web Services and has published many online tutorials as well as the book Flask by Example.
Read more about Gareth Dwyer

Italo Maia
Italo Maia
author image
Italo Maia

Italo Maia is a full-stack developer with 10 years of experience in creating software for the mobile, Web, and desktop environments, having dedicated most of the last few years to development with Python and web technologies. Author of Flask-Empty, a popular skeleton for Flask projects that aggregates good practices and recipes for quick prototyping, he is active in the Brazilian Python communities, having open source tools and libraries available in GitHub and Bitbucket.
Read more about Italo Maia

View More author details
Right arrow

What can you do with Jinja2?


Jinja2 is pretty slick. You can use it with template files or strings; you can use it to create formatted text, such as HTML, XML, Markdown, and e-mail content; you can put together templates, reuse templates, and extend templates; you can even use extensions with it. The possibilities are countless, and combined with nice debugging features, auto-escaping, and full unicode support.

Note

Auto-escaping is a Jinja2 configuration where everything you print in a template is interpreted as plain text, if not explicitly requested otherwise. Imagine a variable x has its value set to <b>b</b>. If auto-escaping is enabled, {{ x }} in a template would print the string as given. If auto-escaping is off, which is the Jinja2 default (Flask's default is on), the resulting text would be b.

Let's understand a few concepts before covering how Jinja2 allows us to do our coding.

First, we have the previously mentioned curly braces. Double curly braces are a delimiter that...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Building Web Applications with Flask
Published in: Jun 2015Publisher: ISBN-13: 9781784396152

Authors (4)

author image
Italo M Campelo Maia

Italo Maia is a full-stack developer with 10 years of experience in creating software for the mobile, Web, and desktop environments, having dedicated most of the last few years to development with Python and web technologies. Author of Flask-Empty, a popular skeleton for Flask projects that aggregates good practices and recipes for quick prototyping, he is active in the Brazilian Python communities, having open source tools and libraries available in GitHub and Bitbucket.
Read more about Italo M Campelo Maia

author image
Jack Stouffer

Jack Stouffer is a programmer who has several years of experience in designing web applications. He switched to Flask three years ago for all his projects. He currently works for Apollo America in Auburn Hills, Michigan, and writes internal business tools and software using Python, Flask, and JavaScript. Jack is a believer and supporter of open source technology. When he released his Flask examples with the recommended best practices on GitHub (https://github.com/JackStouffer), it became one of the most popular Flask repositories on the site. Jack has also worked as a reviewer for Flask Framework Cookbook, Packt Publishing.
Read more about Jack Stouffer

author image
Gareth Dwyer

Gareth Dwyer hails from South Africa but now lives in Europe. He is a software engineer and author and is currently serving as the CTO at the largest coding education provider in Africa. Gareth is passionate about technology, education, and sharing knowledge through mentorship. He holds four university degrees in computer science and machine learning, with a specialization in natural language processing. He has worked with companies such as Amazon Web Services and has published many online tutorials as well as the book Flask by Example.
Read more about Gareth Dwyer

author image
Italo Maia

Italo Maia is a full-stack developer with 10 years of experience in creating software for the mobile, Web, and desktop environments, having dedicated most of the last few years to development with Python and web technologies. Author of Flask-Empty, a popular skeleton for Flask projects that aggregates good practices and recipes for quick prototyping, he is active in the Brazilian Python communities, having open source tools and libraries available in GitHub and Bitbucket.
Read more about Italo Maia