WEBVTT

0
00:00.090 --> 00:04.860
Hey guys, welcome to day 57 of 100 Days of Code. Today

1
00:04.860 --> 00:09.480
we're going to be digging deeper into building more advanced Flask applications.

2
00:10.050 --> 00:12.720
And in order to do that, we're going to be learning about URL

3
00:12.720 --> 00:15.630
building and templating with Jinja.

4
00:16.470 --> 00:19.470
So very often when you're creating a website,

5
00:19.800 --> 00:24.800
you'll get cases where you actually don't want to create the page entirely from

6
00:24.810 --> 00:26.520
scratch. For example,

7
00:26.520 --> 00:31.520
if you had a blog and you wanted to have several different posts in the blog,

8
00:32.430 --> 00:36.660
you don't want to create a separate HTML file for each blog post.

9
00:37.140 --> 00:37.920
So in that case,

10
00:37.920 --> 00:42.920
it's really helpful to have a templating language where you can replace bits of

11
00:43.650 --> 00:46.290
that blog with dynamic content.

12
00:47.250 --> 00:48.960
And that's where Jinja comes in.

13
00:49.230 --> 00:52.080
This is a templating language built for Python,

14
00:52.530 --> 00:55.890
and it's going to allow us to create the general layout of our blog,

15
00:56.070 --> 01:00.720
the styling and the structure, and then to replace the content, for example,

16
01:00.720 --> 01:05.720
the title or the subtitle or the body with dynamic content

17
01:05.910 --> 01:09.420
that's generated each time we load a specific page.

18
01:10.320 --> 01:12.210
And by the end of today,

19
01:12.240 --> 01:16.980
you will have built a very simple blog with a number of blog posts.

20
01:17.220 --> 01:19.560
So here we can see the title and subtitle.

21
01:19.920 --> 01:23.460
And then when we click on read to see the blog post in detail,

22
01:23.730 --> 01:25.650
we go to a different page.

23
01:25.980 --> 01:29.970
And depending on which of these blog posts we've clicked on,

24
01:30.240 --> 01:33.690
you can see that we're rendering basically the same layout,

25
01:33.720 --> 01:36.300
the same styling and the same structure,

26
01:36.540 --> 01:39.570
but each time for each of these pages,

27
01:39.930 --> 01:44.160
we're getting some different content. So that's the goal.

28
01:44.550 --> 01:48.270
And once you're ready, head over to the next lesson and we'll get started.