From the course: Flask Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Page templates in Flask with Jinja

Page templates in Flask with Jinja

From the course: Flask Essential Training

Start my 1-month free trial

Page templates in Flask with Jinja

Now currently, our website is only returning back the strings that we have here in our file. And eventually, we want to do a whole lot more than this, we want to have HTML code, maybe possibly put in some CSS and JavaScript and to cram that all into one string is really going to be a hassle. So we're going to use templates so that we can have all that data stored in a separate HTML file that we can simple just load via one line here. Now, in order to utilize this, we have to create a new project in our directory. So we're going to right click and do a New Folder and name this templates, with an s, this is a special name that the Flask application is going to be looking for to say, hey is there anything inside of templates? And inside of templates, let's go ahead and create a new file. We're going to create a file that represents our home page. So we're going to name it home.html. Now, once you've created this home.html,…

Contents