1
00:00:05,290 --> 00:00:12,220
Welcome everyone to this lecture series on template directories now in the previous section at the very

2
00:00:12,220 --> 00:00:18,160
end, we explore a basic way to connect a view to an existing template file that is an optimal file.

3
00:00:18,700 --> 00:00:25,000
Usually, however, we would like to separate out template folders or directories based on their application

4
00:00:25,000 --> 00:00:29,650
that they're relevant to, rather than have a single template folder for the entire project.

5
00:00:30,580 --> 00:00:35,530
So separating out the template directories by app is more ideal because in the future, you may actually

6
00:00:35,530 --> 00:00:38,110
want to reuse each and go up in a larger project.

7
00:00:38,230 --> 00:00:43,210
For example, maybe you're working on a Django project right now for a social network, and it has a

8
00:00:43,240 --> 00:00:45,160
photo Django app within it.

9
00:00:45,550 --> 00:00:51,100
But then later on, you're working on a new Django project for a marketplace application, and you actually

10
00:00:51,100 --> 00:00:53,020
want to have photos in that marketplace.

11
00:00:53,470 --> 00:00:59,710
Having everything in its own app directory would make it a lot easier to reuse your photos, app and

12
00:00:59,710 --> 00:01:03,760
a new project because all the templates were already included in that directory.

13
00:01:04,060 --> 00:01:09,160
So that's why we don't typically have just a single templates folder for our entire Django project.

14
00:01:09,370 --> 00:01:11,860
Instead, we separate it out per Django app.

15
00:01:13,180 --> 00:01:18,430
Now, in order for the Django project to be aware of the app's template directory existence, we do

16
00:01:18,430 --> 00:01:24,700
need to register that custom Django app in the settings that pie file under the installed app's variable.

17
00:01:24,850 --> 00:01:29,740
And we're right now going to go through a series of steps, and the most important one for registering

18
00:01:29,860 --> 00:01:35,920
these templates is this one going to installed apps and then fixing that within settings that pay for

19
00:01:35,920 --> 00:01:36,940
the actual project.

20
00:01:37,960 --> 00:01:42,940
So what I'm going to do right now is before we actually jump to our code editor is simply describe the

21
00:01:42,940 --> 00:01:47,320
process to create a template directory for custom jungle app before you walk through it.

22
00:01:47,770 --> 00:01:52,390
And as an important note, I'm actually going to add a bunch of steps that don't really do anything

23
00:01:52,390 --> 00:01:56,540
for us right now for templates, but they are important later on for models.

24
00:01:56,560 --> 00:02:00,520
So we're going to run them anyways, since this is going to be your typical workflow.

25
00:02:00,640 --> 00:02:04,880
We don't technically know about models yet, but in the next section we will cover them.

26
00:02:05,170 --> 00:02:10,180
And I don't want you to see this workflow for the very first time when you learn about models and said,

27
00:02:10,389 --> 00:02:13,780
we're going to go through the steps right now, even though we're just dealing with templates.

28
00:02:14,440 --> 00:02:15,760
So let's talk about these steps.

29
00:02:16,180 --> 00:02:20,860
Step one you're pretty much already familiar with, which is the very basics of setting up a new Django

30
00:02:20,860 --> 00:02:21,190
app.

31
00:02:21,610 --> 00:02:26,360
You create the app directory with the Manage Sky Start app command, where you would just say managed

32
00:02:26,360 --> 00:02:31,630
up high start app and then my app, first app or whatever the name of your application happens to be

33
00:02:31,630 --> 00:02:32,500
within the project.

34
00:02:32,950 --> 00:02:37,750
Then inside that app, you open up your URLs that I create views, not pie.

35
00:02:37,750 --> 00:02:44,620
And then you go ahead and connect the views to specific URLs and you again have to remember to map the

36
00:02:44,620 --> 00:02:46,900
actual app, your URLs to the project.

37
00:02:46,900 --> 00:02:53,260
Your URLs recall we did that when we mapped things using the include function inside of the project

38
00:02:53,260 --> 00:02:54,220
URLs file.

39
00:02:54,760 --> 00:02:55,750
OK, so let's step one.

40
00:02:56,020 --> 00:02:58,210
We've technically I've already done this all before.

41
00:02:59,390 --> 00:03:02,210
Step two is running the migrant command.

42
00:03:02,390 --> 00:03:07,220
And what this does is when you start dealing with models, you have to look at the Django project,

43
00:03:07,220 --> 00:03:12,500
know which apps are going to be installed and updated within settings that pie.

44
00:03:12,950 --> 00:03:16,610
So we end up running the Migrant Command Python managed up pie migrate.

45
00:03:17,000 --> 00:03:19,460
And what this command looks like, it goes.

46
00:03:19,460 --> 00:03:25,340
And inside settings, that pie takes a look and installed apps and creates any necessary database tables.

47
00:03:25,790 --> 00:03:30,800
Keep in mind, this isn't technically necessary for us at this very moment, but it is a very typical

48
00:03:30,800 --> 00:03:33,470
step as you begin to create models in your workflow.

49
00:03:33,500 --> 00:03:35,090
So we'll go ahead and run it right now.

50
00:03:35,450 --> 00:03:36,260
So again, that's Python.

51
00:03:36,260 --> 00:03:37,070
Manage the pie.

52
00:03:37,070 --> 00:03:37,610
Migrate.

53
00:03:38,920 --> 00:03:45,460
Then step three, which is highly relevant to us right now, is actually go inside of Django app.

54
00:03:45,730 --> 00:03:52,360
You check the apps that PY file that's created automatically for you and then you register the app config

55
00:03:52,360 --> 00:03:56,410
class to the installed apps inside of settings that pie.

56
00:03:57,160 --> 00:04:00,550
So step two really has to do if database tables and models.

57
00:04:01,000 --> 00:04:07,810
Step three is actually doing that, linking to let your project be aware of the app directories, which

58
00:04:07,810 --> 00:04:11,470
will eventually let it be aware of the template directory inside the app.

59
00:04:11,950 --> 00:04:17,829
Now we have actually open apps that yet, so you may be a little confused by what I mean by app config

60
00:04:17,829 --> 00:04:22,660
class, but once you open up apps that pie, you'll see something that looks like app config.

61
00:04:22,930 --> 00:04:27,880
Essentially just take a line of code there and then stick it into the list of installed underscore apps

62
00:04:28,150 --> 00:04:28,430
again.

63
00:04:28,450 --> 00:04:29,960
Step three Most critical one.

64
00:04:30,160 --> 00:04:33,370
But it makes a lot more sense when we actually see it inside the code editor.

65
00:04:33,730 --> 00:04:37,900
So remember this step, but don't worry about it too much right now in detail because we will cut through

66
00:04:37,900 --> 00:04:38,200
this.

67
00:04:39,280 --> 00:04:45,340
Now, step four is to register the app and any database changes with jingo by running the following

68
00:04:45,340 --> 00:04:50,290
command Python managed API make migrations and then the name of your app, such as My App.

69
00:04:50,650 --> 00:04:55,300
Again, not super relevant for us until we've actually created models, but it's typically the next

70
00:04:55,480 --> 00:04:57,790
line in workflow, so we'll go ahead and run it.

71
00:04:58,870 --> 00:05:03,130
Then step five, we go ahead and run Python, managed a pie migrate again.

72
00:05:03,490 --> 00:05:06,370
And that's going to create the model tables in our database.

73
00:05:07,060 --> 00:05:09,880
Again, not really necessary for us, but it will be wants to create models.

74
00:05:11,110 --> 00:05:17,210
Then finally, in step six or we end up doing which is highly relevant to us is create the actual templates

75
00:05:17,230 --> 00:05:21,370
directory inside of our app directory with this structure.

76
00:05:21,550 --> 00:05:28,420
So let's imagine we've created a new project called My Site, and then we created a new application

77
00:05:28,420 --> 00:05:34,120
called My App, which lives inside our jingo project, my site within my app.

78
00:05:34,300 --> 00:05:40,090
I'm going to create a folder called Templates previously created this templates directory at a project

79
00:05:40,090 --> 00:05:41,410
level underneath my site.

80
00:05:41,740 --> 00:05:46,780
Now I'm putting it inside my app, and then you'll notice I do something kind of funny here.

81
00:05:47,170 --> 00:05:53,410
I create another subdirectory sharing the my app name, and then I start having my template files like

82
00:05:53,410 --> 00:05:55,510
example the HTML or home.

83
00:05:55,510 --> 00:06:00,760
That Page HTML index creates HTML page of each HTML, etc. This is where all those HTML files would

84
00:06:00,760 --> 00:06:01,420
end up living.

85
00:06:02,230 --> 00:06:08,650
So you're probably wondering what's the deal with having to use my app again when clearly templates

86
00:06:08,650 --> 00:06:10,570
is already underneath my app?

87
00:06:11,850 --> 00:06:15,570
Well, often you're going to have multiple template files with the same name.

88
00:06:15,870 --> 00:06:22,440
So it's really common to have multiple files called indexed by each HTML one for each app index view

89
00:06:22,440 --> 00:06:22,980
page.

90
00:06:23,070 --> 00:06:28,480
So often, each application has its own little home page, which you'll often end up calling indexed

91
00:06:28,480 --> 00:06:29,340
to each HTML.

92
00:06:29,850 --> 00:06:34,500
Now, unfortunately, because of the way Django searches for matching template names, we want to make

93
00:06:34,500 --> 00:06:37,470
sure we're actually getting the relevant template for an app.

94
00:06:37,710 --> 00:06:42,480
So that's why we end up creating the app subdirectory underneath the template folder.

95
00:06:42,900 --> 00:06:48,150
So that's why we do this to make sure that if anywhere else in my project or any other application,

96
00:06:48,390 --> 00:06:54,480
I have an example that HTML, I don't accidentally get it confused by having it specifically underneath

97
00:06:54,480 --> 00:06:59,730
the sub directory underneath templates underneath the app, so you can actually read the documentation

98
00:06:59,730 --> 00:07:00,270
on this.

99
00:07:00,330 --> 00:07:05,470
Again, there's a little note here you could technically get away with just saying my app forward slash

100
00:07:05,520 --> 00:07:09,360
templates rather than creating a secondary my app subdirectory.

101
00:07:09,660 --> 00:07:14,310
But again, Django will choose the very first template it finds whose name matches.

102
00:07:14,610 --> 00:07:18,810
And if you have multiple applications with multiple templates that have the same name, you're going

103
00:07:18,810 --> 00:07:23,250
to want to be able to further distinguish them, which is why we use that subdirectory.

104
00:07:23,460 --> 00:07:25,740
That happens to share the same app name.

105
00:07:26,970 --> 00:07:32,310
OK, so I know these steps may seem a little complicated right now, especially since none of them really

106
00:07:32,310 --> 00:07:37,230
apply to us, except for the fact of setting up installed apps and then setting up our directory.

107
00:07:37,470 --> 00:07:42,510
But we are going to go through them at the command line to get used to this workflow of running migrations

108
00:07:42,510 --> 00:07:43,400
and making them.

109
00:07:43,410 --> 00:07:48,840
So let's go ahead and go to the code editor, set up a new project, a new application and then set

110
00:07:48,840 --> 00:07:50,870
up our templates to head over there now.

111
00:07:52,910 --> 00:07:55,100
OK, so here I am at Visual Studio Code.

112
00:07:55,460 --> 00:08:00,020
We are going to start from the very beginning, we always do this, but it is good practice to just

113
00:08:00,020 --> 00:08:04,850
get the muscle memory, so to speak, of creating a project and a new application.

114
00:08:05,840 --> 00:08:09,020
Here I am underneath an empty folder called Jingle Lectures.

115
00:08:10,090 --> 00:08:14,560
I'm going to call Django Bash Batman and let's start a new project.

116
00:08:14,620 --> 00:08:19,540
We do that by saying Start Project, and let's just call it my underscore site.

117
00:08:20,290 --> 00:08:25,510
Again, you can call it whatever you want, but that initial command should set you up to have my site

118
00:08:25,840 --> 00:08:29,680
and then the critical manage that pie file, which we can use to create an application.

119
00:08:30,310 --> 00:08:37,049
So we're going to seed into my site and now we're going to create an application.

120
00:08:37,059 --> 00:08:42,130
We run this by saying Python managed our pie and then start app.

121
00:08:42,490 --> 00:08:44,800
Easy to remember because it's kind of similar to start project.

122
00:08:45,250 --> 00:08:49,130
And then what we end up doing is typing out the name of your application.

123
00:08:49,150 --> 00:08:51,520
I'm going to call it my underscore app.

124
00:08:52,000 --> 00:08:54,760
You do need to remember this name later on, so keep that in mind.

125
00:08:56,580 --> 00:08:59,760
OK, so now you should have my app.

126
00:09:00,330 --> 00:09:04,590
And what we're going to do right now is create a simple view that connects to a template which technically

127
00:09:04,590 --> 00:09:07,130
doesn't exist yet and then will map the URLs.

128
00:09:07,410 --> 00:09:17,250
So underneath my app, go ahead and right click create a new file called URLs Dot Pie Hit Enter.

129
00:09:17,670 --> 00:09:20,040
And let's also open up views pie.

130
00:09:20,460 --> 00:09:23,430
So by default, you have render already imported for you.

131
00:09:23,760 --> 00:09:27,480
So jingo essentially always expect you to be rendering a template usually.

132
00:09:28,110 --> 00:09:34,890
So we're going to create a function and we're going to call it example underscore view it takes in a

133
00:09:34,890 --> 00:09:35,550
request.

134
00:09:36,580 --> 00:09:44,650
And then from there, we're going to return a render which takes in the request and then we connect

135
00:09:44,650 --> 00:09:48,520
it to a template and this template is going to be located underneath.

136
00:09:49,680 --> 00:09:53,570
My app forward slash, and then it's going to be example the HTML.

137
00:09:54,090 --> 00:09:56,570
Something to keep in mind is this directory.

138
00:09:56,580 --> 00:10:02,920
My app is not actually referring to the current my app directory that exists instead.

139
00:10:02,940 --> 00:10:05,610
Eventually, we're we're going to do is have something that's in there.

140
00:10:05,760 --> 00:10:11,670
My app templates, my app, for example, that each HTML.

141
00:10:12,150 --> 00:10:21,180
So this my app example, HTML is going to be referring to this portion of that directory path.

142
00:10:21,570 --> 00:10:25,080
What's going to happen is later on, we need to tell the Django Project Settings files.

143
00:10:25,380 --> 00:10:30,600
Hey, by the way, we have this templates directory underneath my app, which is essentially what the

144
00:10:30,600 --> 00:10:31,950
rest of the lecture is going to do.

145
00:10:32,370 --> 00:10:35,880
But before we do that, we should connect this to a URL path.

146
00:10:36,700 --> 00:10:40,680
So come back here to your URLs and let's go ahead and create that.

147
00:10:41,250 --> 00:10:43,020
So URLs, we simply say.

148
00:10:44,130 --> 00:10:47,550
From Jingo Dot Earle's import path.

149
00:10:48,930 --> 00:10:52,020
From Dot's import views.

150
00:10:53,060 --> 00:10:55,670
And then we create our URL patterns list.

151
00:10:56,870 --> 00:11:01,520
And inside this list, we are going to call Path.

152
00:11:02,930 --> 00:11:03,800
Empty string.

153
00:11:04,830 --> 00:11:09,120
And connected to the views that's of views, Dot and I called it example view.

154
00:11:09,870 --> 00:11:14,490
OK, so that's it for what's underneath our application.

155
00:11:14,790 --> 00:11:19,710
We do need to connect this set of early patterns to our project level URLs.

156
00:11:20,070 --> 00:11:22,290
So let's go ahead and open that up.

157
00:11:22,680 --> 00:11:25,500
So we come to my site.

158
00:11:26,500 --> 00:11:31,180
You URLs that pie on a project level again, the way you know it's at a project level is it includes

159
00:11:31,180 --> 00:11:34,240
all these directions and we essentially need to follow this bottom one.

160
00:11:34,630 --> 00:11:37,150
So we're going to add a new pattern here.

161
00:11:37,990 --> 00:11:44,110
We're going to say path and let's have this be the path my app forward slash.

162
00:11:44,290 --> 00:11:49,810
And then this is then going to include, let's make sure we have a comma there.

163
00:11:50,230 --> 00:11:52,420
Comma include.

164
00:11:53,020 --> 00:11:56,630
And it's going to be located underneath my app Dot.

165
00:11:57,040 --> 00:12:00,460
You are else a really common mistake.

166
00:12:00,460 --> 00:12:04,420
Here is two parts one you forget to actually import include.

167
00:12:05,140 --> 00:12:07,030
So let's remember to import that.

168
00:12:07,360 --> 00:12:12,190
And then to a really common mistake is to forget the comma that makes this a list.

169
00:12:12,580 --> 00:12:18,790
So often I'll see students put this here as the first item, but then they forget that comma.

170
00:12:18,970 --> 00:12:23,740
So then you get some error and this one's a little harder to debug because it starts thinking this is

171
00:12:23,740 --> 00:12:29,080
some sort of weird long item that you're trying to define, and all you needed to do was put in that

172
00:12:29,080 --> 00:12:29,500
comma.

173
00:12:29,950 --> 00:12:35,020
So by far, it's probably the most popular error I see students make is they forget these commas inside

174
00:12:35,020 --> 00:12:36,460
of the list that Django requires.

175
00:12:37,390 --> 00:12:39,100
So go ahead and save that.

176
00:12:39,490 --> 00:12:44,710
And we should be good to go as far as actually connecting that view on a project level.

177
00:12:45,160 --> 00:12:52,840
Well, we still haven't done yet is we still technically don't have this if we go back to use this template

178
00:12:52,840 --> 00:12:54,550
and this directory doesn't exist yet.

179
00:12:54,610 --> 00:13:00,070
So let's begin our migrations that right now, some of them won't really apply to us, but they are

180
00:13:00,070 --> 00:13:04,690
important as part of the general process, especially when we begin to introduce models.

181
00:13:05,200 --> 00:13:11,020
So back here at the command line, I'm going to use the managed pie file and I'm going to say Python.

182
00:13:12,280 --> 00:13:20,860
Managed by Migrate Hit Enter, and you should see a bunch of saying saying, apply, OK, etc. If you

183
00:13:20,860 --> 00:13:26,230
get an error at the state, it's pretty much 100 percent a typo somewhere on your part.

184
00:13:26,620 --> 00:13:32,110
Either you forgot a comma, you misspelled something, forgot an import, etc. So if you get an error,

185
00:13:32,110 --> 00:13:33,610
just go back through the files.

186
00:13:33,610 --> 00:13:39,730
Go back to this video slowly, and it's super easy to create a simple typo here that kind of messes

187
00:13:39,730 --> 00:13:40,210
everything up.

188
00:13:40,210 --> 00:13:41,290
So just keep that in mind.

189
00:13:41,890 --> 00:13:44,860
However, if you get all these OK messages, you are good to go.

190
00:13:45,610 --> 00:13:47,230
So we made our first migration.

191
00:13:47,300 --> 00:13:51,070
We need to do now is actually tell the project.

192
00:13:51,310 --> 00:13:54,520
By the way, we created this app and I want it to be installed.

193
00:13:55,000 --> 00:13:55,630
How do we do that?

194
00:13:56,020 --> 00:14:01,840
Well, you'll notice that when you created my app, there's this file called apps that pie that was

195
00:14:01,840 --> 00:14:06,580
created automatically for you and the even creates this app configuration class.

196
00:14:06,880 --> 00:14:13,540
And it's a really cool aspect is it converts your camel casing name to a or actually your snake case,

197
00:14:13,540 --> 00:14:15,040
your name to a camel casing name.

198
00:14:15,430 --> 00:14:21,160
So now we have this class that's automatically called my app config, and it drew that from our snake

199
00:14:21,160 --> 00:14:22,900
casing of my app.

200
00:14:23,320 --> 00:14:28,630
And what I need to do is go to my project's settings about Pi file and say, Oh, this is going to be

201
00:14:28,630 --> 00:14:29,770
my installed app.

202
00:14:29,950 --> 00:14:32,740
It does that through this app configuration class.

203
00:14:33,250 --> 00:14:40,450
So we're going to do is go to Settings API and then go to where it has the list of installed apps.

204
00:14:41,020 --> 00:14:46,360
And then what you're going to say is, by the way, I created this new app and here's its configuration

205
00:14:46,360 --> 00:14:46,690
file.

206
00:14:47,260 --> 00:14:48,610
So are going to pass in the new string.

207
00:14:49,570 --> 00:14:57,040
The string starts off with my app, because that's the directory, this is under dot apps because the

208
00:14:57,040 --> 00:15:02,680
file name itself is apps, not Pie Dot and then whatever this configuration file happens to be called.

209
00:15:03,160 --> 00:15:07,810
So if you go to apps that pie, in our case, that would be my app config.

210
00:15:08,350 --> 00:15:10,150
So I'm going to copy that.

211
00:15:11,270 --> 00:15:13,040
Let's go to settings about pie.

212
00:15:14,280 --> 00:15:16,740
And you can paste it in my app config.

213
00:15:17,130 --> 00:15:19,570
Don't forget your comma here again.

214
00:15:19,590 --> 00:15:24,060
Super common mistake that as you add in these apps, you forget that comma and then you get this kind

215
00:15:24,060 --> 00:15:25,500
of weird error that's hard to debug.

216
00:15:26,100 --> 00:15:27,900
Go ahead and save that change.

217
00:15:28,290 --> 00:15:31,770
And this is kind of critical to let your project overall know.

218
00:15:32,100 --> 00:15:37,710
You can start looking at this app directory to begin to connecting to templates and views and so on.

219
00:15:38,490 --> 00:15:44,550
So now we're going to do is once you've confirmed that our configuration is inside our installed apps.

220
00:15:44,970 --> 00:15:51,570
We're going to come down to our command line, make clear this and then we're going to say Python.

221
00:15:52,720 --> 00:15:53,830
Manage that pie.

222
00:15:55,550 --> 00:16:02,630
Make migrations and then the name of your application, which was my underscore app hit enter.

223
00:16:02,900 --> 00:16:07,700
And if you don't have any models for now, you'll see something that says, Hey, I don't detect any

224
00:16:07,700 --> 00:16:08,880
changes in app.

225
00:16:08,900 --> 00:16:12,170
My app that should be the message you get later on.

226
00:16:12,170 --> 00:16:17,060
We're going to get more detailed information when we actually have changes to a model and database.

227
00:16:17,840 --> 00:16:22,460
Once you actually were to change things in a model and database and you wanted to post those changes,

228
00:16:22,880 --> 00:16:28,730
the other command you would do is you would say python, managed pie and migrate.

229
00:16:29,030 --> 00:16:32,170
We're going to go ahead and do that right now just to get the flow going.

230
00:16:32,180 --> 00:16:36,470
But again, you should see, by the way, there was no real migrations to apply.

231
00:16:37,540 --> 00:16:37,840
All right.

232
00:16:38,140 --> 00:16:40,180
So we should be good to go.

233
00:16:40,510 --> 00:16:46,300
And now the project is aware of the fact that if you scroll down here underneath settings that pie,

234
00:16:46,930 --> 00:16:51,400
what's critical is I no longer need to worry about this directories structure.

235
00:16:51,850 --> 00:16:59,830
Instead, I now have app directories equal to True, which tells Django on a project or app settings

236
00:16:59,830 --> 00:17:00,220
level.

237
00:17:00,490 --> 00:17:03,720
By the way, there's going to be a templates folder inside the application.

238
00:17:03,730 --> 00:17:04,780
Feel free to check that.

239
00:17:05,109 --> 00:17:06,670
So you have to make sure this is true.

240
00:17:06,700 --> 00:17:13,119
It should be true by default, but just make sure underneath templates you have app directories is true.

241
00:17:13,930 --> 00:17:17,980
OK, so that allows us to then do the following underneath my app.

242
00:17:18,280 --> 00:17:20,740
I'm going to right click Create a new folder.

243
00:17:21,880 --> 00:17:23,050
Call it templates.

244
00:17:23,410 --> 00:17:25,300
It has to be called templates, so keep that in mind.

245
00:17:26,440 --> 00:17:31,810
Then underneath templates, I'm going to create a new folder and I'm going to call it.

246
00:17:32,950 --> 00:17:33,700
My app.

247
00:17:34,810 --> 00:17:37,810
And again, this should start matching what we said here.

248
00:17:38,260 --> 00:17:39,910
My app templates my app.

249
00:17:40,330 --> 00:17:45,460
And then here I'm going to create a new file and let's call it example the HTML.

250
00:17:46,420 --> 00:17:47,830
OK, we are good to go.

251
00:17:47,860 --> 00:17:50,710
Now, what do we actually want to show inside?

252
00:17:50,710 --> 00:17:56,140
Example that each time it's really up to you, but I'm not going to type in doc and this should autocomplete

253
00:17:56,140 --> 00:17:58,840
which enter here and inside the body.

254
00:17:59,150 --> 00:18:08,560
Let's make an one heading or header that says something like example each HTML templates connected.

255
00:18:09,070 --> 00:18:10,970
Go ahead and save that change.

256
00:18:10,990 --> 00:18:12,640
And now let's run the site.

257
00:18:12,970 --> 00:18:20,350
Remember, this is going to show up at the actual my app, so it's going to be homepage forward.

258
00:18:20,350 --> 00:18:21,220
Slash my app.

259
00:18:21,670 --> 00:18:22,530
So let's run this.

260
00:18:22,530 --> 00:18:23,410
We're going to see Python.

261
00:18:24,970 --> 00:18:28,960
Managed pie run server hit enter.

262
00:18:29,470 --> 00:18:31,550
Looks like we're actually good, live and running.

263
00:18:31,600 --> 00:18:40,090
We bring in the actual website going to go to one two seven zero zero one.

264
00:18:41,330 --> 00:18:47,240
8000 ports, and they bring in that browser, if you just go to the homepage, you should get a four

265
00:18:47,240 --> 00:18:47,690
or four.

266
00:18:47,960 --> 00:18:50,690
But remember, we're defining this underneath my app.

267
00:18:51,050 --> 00:18:52,670
So then if you go to forward slash.

268
00:18:53,830 --> 00:18:56,730
My app hit Enter Perfect.

269
00:18:56,770 --> 00:19:00,040
We were able to connect our example HTML template.

270
00:19:00,460 --> 00:19:01,340
If you get stuck on this.

271
00:19:01,360 --> 00:19:07,600
Go ahead and check out our files and you can see if you had any typos there, but hopefully you're able

272
00:19:07,600 --> 00:19:08,860
to get used to those steps.

273
00:19:08,890 --> 00:19:10,930
These are the kind of steps you're going to be running all the time.

274
00:19:11,260 --> 00:19:15,640
So if you ever get stuck, I would say just keep rewatching the video until you kind of memorize the

275
00:19:15,640 --> 00:19:20,470
actual workflow and the steps, especially because we'll be running these steps all the time with models.

276
00:19:20,800 --> 00:19:22,210
But hopefully that wasn't too bad.

277
00:19:22,840 --> 00:19:26,020
All right now, though, we understand how to connect an HTML template.

278
00:19:26,290 --> 00:19:34,660
We have a lot more powerful tools at our disposal to connect Django Python logic to HTML, CSS, static

279
00:19:34,660 --> 00:19:35,650
files and so on.

280
00:19:36,220 --> 00:19:36,550
OK.

281
00:19:36,940 --> 00:19:37,420
Thanks.

282
00:19:37,450 --> 00:19:38,800
And I'll see you at the next lecture.

