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
From the course: Flask Essential Training
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Install Flask and Pipenv3m 11s
-
Create your first route in a Flask project6m 4s
-
Flask's development environment4m 56s
-
Page templates in Flask with Jinja4m 29s
-
Passing data into Flask apps with forms6m 11s
-
Passing form variables to other routes in Flask4m 20s
-
Using GET and POST requests in Flask3m 31s
-
-
-
-
-