1
00:00:05,130 --> 00:00:09,630
Welcome back, everyone, to this lecture on installing and setting up our coding environment.

2
00:00:11,180 --> 00:00:17,690
Now I want to make clear a little bit of vocabulary as there is some confusion when you go to the Microsoft

3
00:00:17,690 --> 00:00:23,930
Visual Studio site on the difference between an I.D. and an editor in it is an integrated development

4
00:00:23,930 --> 00:00:27,950
environment and typically it's a larger piece of software where you can code.

5
00:00:28,130 --> 00:00:33,170
But it also has many integrations and you can think of those specific examples, like having source

6
00:00:33,170 --> 00:00:38,540
control actually integrated into developer environments or like dot net apps are included in Visual

7
00:00:38,540 --> 00:00:44,930
Studio instead of just Visual Studio code, and an editor itself just allows you to open and edit files.

8
00:00:44,930 --> 00:00:48,800
And there are typically lighter weight programs that open and support editing of files.

9
00:00:49,070 --> 00:00:54,740
They can also actually have many, many different useful features, and often an editor is also just

10
00:00:54,740 --> 00:00:57,620
called an I.D. if it includes enough features.

11
00:00:57,980 --> 00:01:02,990
So keep in mind, these aren't very strict definitions, but I just want to actually tell you the difference

12
00:01:02,990 --> 00:01:07,790
right now, because later on, we'll see that there is a difference between Microsoft Visual Studio

13
00:01:08,060 --> 00:01:09,470
and Visual Studio code.

14
00:01:09,710 --> 00:01:12,380
One is technically an idea and another is an editor.

15
00:01:12,740 --> 00:01:17,030
But let's go into a little more detail about choosing an editor or an I.D..

16
00:01:17,950 --> 00:01:23,500
Keep in mind, choosing a specific coding environment is highly personal, and there are many, many

17
00:01:23,500 --> 00:01:28,180
different options available, and you should feel free to use any development environment or coding

18
00:01:28,180 --> 00:01:33,400
ED that you prefer and feel comfortable with, and that second part is key that you feel comfortable

19
00:01:33,400 --> 00:01:33,610
with.

20
00:01:33,910 --> 00:01:38,650
Don't just go to some editor like Petare if you've never used it before, because we're not going to

21
00:01:38,650 --> 00:01:41,500
use that in this course, we're going to be using Microsoft Visual Studio Code.

22
00:01:41,800 --> 00:01:46,720
So if you've never used any editor, we would suggest that you use Visual Studio Code that we can follow

23
00:01:46,720 --> 00:01:48,250
along exactly with us.

24
00:01:48,340 --> 00:01:52,900
But if you're already inexperienced developer and have your own preferences for a coding environment,

25
00:01:53,140 --> 00:01:56,200
please feel free to go ahead and follow along in that coding editor.

26
00:01:57,520 --> 00:01:59,740
Now, as I mentioned, there's many different types of options.

27
00:02:00,130 --> 00:02:05,410
Some of them that are very popular are petroleum, the atom tax ed, the supply and tax ED and then

28
00:02:05,410 --> 00:02:06,820
Microsoft Visual Studio.

29
00:02:07,060 --> 00:02:11,020
And there's technically two different types of that Microsoft Visual Studio and Visual Studio code.

30
00:02:11,260 --> 00:02:12,640
We'll get into that in just a little bit.

31
00:02:13,030 --> 00:02:18,700
And in a very important note specific to Django is that notebook based editors like the Jupyter Notebook

32
00:02:18,850 --> 00:02:21,040
or sometimes the Spider editor.

33
00:02:21,250 --> 00:02:26,020
They won't really work well for Django because we need to support more than just Python code.

34
00:02:26,200 --> 00:02:31,210
We need to be able to connect that to the template code like HTML or CSS or JavaScript.

35
00:02:31,480 --> 00:02:36,700
So we have to be able to open many different types of files, not just Python specific notebook files.

36
00:02:38,310 --> 00:02:43,560
Now, the other features you should be looking for for Django is that it should have syntax highlighting

37
00:02:43,560 --> 00:02:47,370
support for multiple languages not just Python, but also HTML and CSS.

38
00:02:47,580 --> 00:02:51,480
Since we're going to be working with many different file types and it should also ideally have a command

39
00:02:51,480 --> 00:02:57,510
line interface in order to run the actual Django specific commands that create projects and applications,

40
00:02:57,750 --> 00:02:59,910
those actually need to be run at the command line.

41
00:03:00,450 --> 00:03:03,930
So some other nice to have are customizable styling and themes.

42
00:03:03,930 --> 00:03:08,460
And then what's also nice but not necessary is be able to have a web browser inside the editor.

43
00:03:08,700 --> 00:03:10,710
We ourselves will actually use that sort of feature.

44
00:03:10,890 --> 00:03:15,750
I'm just gonna be dragging over the actual Chrome browser when we actually run our web applications.

45
00:03:16,350 --> 00:03:16,650
OK.

46
00:03:17,070 --> 00:03:21,810
So for this specific course, we decided to use the free version of Microsoft Visual Studio Code.

47
00:03:22,230 --> 00:03:25,410
As I noted, this is technically different than Microsoft Visual Studio.

48
00:03:25,740 --> 00:03:29,850
So if you just Google search Microsoft Visual Studio, you'll actually go to a website that has two

49
00:03:29,850 --> 00:03:31,170
different download options.

50
00:03:31,200 --> 00:03:37,170
Visual Studio Code The Microsoft Visual Studio Just to clarify things, we're using Visual Studio code.

51
00:03:37,350 --> 00:03:39,750
So look for that code as that last part.

52
00:03:41,040 --> 00:03:45,540
So what's nice about Microsoft Visual Studio Code one it's free to even though it's from Microsoft.

53
00:03:45,720 --> 00:03:50,490
It's actually cross-platform compatible, so work on Windows, macOS, Linux, it's actually highly

54
00:03:50,490 --> 00:03:55,800
customizable, has many built in features enough that maybe some people would call it an I.D., and

55
00:03:55,800 --> 00:03:57,580
it also supports multiple file types.

56
00:03:57,960 --> 00:04:02,910
So we're going to do now is download it at code that Visual Studio dot com or it can just Google search

57
00:04:02,910 --> 00:04:03,990
Visual Studio code.

58
00:04:04,230 --> 00:04:06,540
Again, this is different than just Visual Studio.

59
00:04:06,810 --> 00:04:09,780
So let me show this link and see how we can download this and set it up.

60
00:04:09,870 --> 00:04:13,110
OK, here I am at Code Visual Studio dot com.

61
00:04:13,410 --> 00:04:19,589
If you go to this website, it should have the actual download available for you, either at the top

62
00:04:19,589 --> 00:04:23,310
or on the front of the page, and it should automatically detect your operating system.

63
00:04:23,580 --> 00:04:27,930
So here I already have download for windows, but you could also click other platforms and I'll just

64
00:04:27,930 --> 00:04:31,890
give you a list of all downloads, either for Windows, Linux or Mac OS.

65
00:04:32,070 --> 00:04:36,870
Something to keep in mind if you just Google search Microsoft Visual Studio, it may take you to Visual

66
00:04:36,870 --> 00:04:38,470
Studio that Microsoft.com.

67
00:04:38,760 --> 00:04:43,380
And here it's actually introducing it to the Visual Studio family, where it's going to have a couple

68
00:04:43,380 --> 00:04:46,770
of options Visual Studio, Visual Studio for Mac and then Visual Studio Code.

69
00:04:47,070 --> 00:04:53,190
Well, we're actually looking for is Visual Studio Code, which comes for Windows, Mac and then Linux

70
00:04:53,190 --> 00:04:53,730
as well.

71
00:04:54,120 --> 00:05:00,930
So this is separate from Visual Studio, which is kind of a heavier weight I.D. And it's kind of made

72
00:05:00,930 --> 00:05:07,230
more for dot net developers than it is for just people programming in any language like Python or Django,

73
00:05:07,230 --> 00:05:07,800
et cetera.

74
00:05:08,100 --> 00:05:12,630
So for example, if we weren't sure which tool is best for us, we could say, OK, I'm going to Windows

75
00:05:12,630 --> 00:05:15,150
Computer and maybe I want to work with Python.

76
00:05:15,540 --> 00:05:17,940
And then it would suggest just Visual Studio code.

77
00:05:18,360 --> 00:05:18,690
OK.

78
00:05:18,720 --> 00:05:22,980
So again, we're dealing with Visual Studio code, not just Visual Studio.

79
00:05:23,370 --> 00:05:27,630
Go ahead and download this and then begin to run the installer.

80
00:05:28,380 --> 00:05:28,720
OK.

81
00:05:28,740 --> 00:05:33,720
So once you start running the installer, you can check out the license agreements, go ahead and accept

82
00:05:33,720 --> 00:05:34,320
the agreement.

83
00:05:34,770 --> 00:05:35,520
I'll hit next.

84
00:05:35,850 --> 00:05:40,200
If you want to have this installed in a different destination that is not the default, you can go ahead

85
00:05:40,200 --> 00:05:40,680
and move it.

86
00:05:40,920 --> 00:05:45,240
Just remember, you need a certain amount of space, typically around 300 megabytes, depending what

87
00:05:45,240 --> 00:05:46,170
version you download.

88
00:05:46,470 --> 00:05:49,560
And then you should also remember where you're actually saving this, too.

89
00:05:49,860 --> 00:05:52,590
I'm just going to choose the default location, and that's OK with me.

90
00:05:53,130 --> 00:05:54,070
I'll click next.

91
00:05:54,090 --> 00:05:57,220
I'll go ahead and select the Start menu folder as Visual Studio.

92
00:05:57,660 --> 00:05:58,350
Click Next.

93
00:05:58,350 --> 00:06:01,590
And then here's kind of the two most important parts.

94
00:06:01,620 --> 00:06:04,530
One is whether or not you want to add this to path.

95
00:06:04,800 --> 00:06:06,980
I would suggest that you do add this to path.

96
00:06:06,990 --> 00:06:10,230
That way, we can easily call this from our command prompt.

97
00:06:10,590 --> 00:06:15,360
The other thing I would suggest you to do is to register the code as an editor for supported file types.

98
00:06:15,720 --> 00:06:20,310
Now, if you're an experienced programmer and you already have your favorite editor and maybe you just

99
00:06:20,310 --> 00:06:25,080
want to explore Visual Studio, you may or may want to uncheck this box because it's going to happen.

100
00:06:25,080 --> 00:06:29,520
If you have some sort of Python script, file somewhere on your computer and you just want to edit it

101
00:06:29,520 --> 00:06:33,810
or double click to open it, then what's going to happen is Microsoft Visual Studio is going to be the

102
00:06:33,810 --> 00:06:36,020
default opening software for that file.

103
00:06:36,030 --> 00:06:37,170
You may or may not want that.

104
00:06:37,440 --> 00:06:38,450
So just keep that in mind.

105
00:06:38,460 --> 00:06:41,770
And then these are the ones kind of up to you, whether you want to create a desktop icon.

106
00:06:41,790 --> 00:06:42,730
I'll go ahead and create one.

107
00:06:42,870 --> 00:06:43,490
And that's it.

108
00:06:43,500 --> 00:06:49,110
So next, say everything's OK with you, and let's go ahead and install this to fast forward until this

109
00:06:49,110 --> 00:06:49,920
is done installing.

110
00:06:50,430 --> 00:06:51,900
All right, this is done installing.

111
00:06:51,900 --> 00:06:54,120
I'm going to launch Visual Studio code now.

112
00:06:54,450 --> 00:06:57,000
Click Finish and just check that Visual Studio launch button.

113
00:06:57,540 --> 00:07:03,240
OK, so this is what Visual Studio looks like once it's launched and actually has a step by step process

114
00:07:03,240 --> 00:07:08,940
of things you may want to do, typical to a new set up of your environment part, the first one is choosing

115
00:07:08,940 --> 00:07:09,600
a color theme.

116
00:07:09,600 --> 00:07:14,730
You can go light, dark or high contrast, or if you want, you can go ahead and download a theme from

117
00:07:14,730 --> 00:07:15,210
the internet.

118
00:07:15,450 --> 00:07:20,100
You can actually click here, browse color themes, and there's actually a bunch already installed for

119
00:07:20,100 --> 00:07:20,300
you.

120
00:07:20,310 --> 00:07:23,670
So if you want, you can explore those, for example, a red color theme.

121
00:07:24,210 --> 00:07:28,800
It's probably not going to default here, but what we're going to do is we're just going to use the

122
00:07:28,800 --> 00:07:31,560
high contrast dark one that should be pretty readable.

123
00:07:31,890 --> 00:07:38,040
And if you want, you can also do things like sync from other devices, add a shortcut, etc. But eventually,

124
00:07:38,040 --> 00:07:38,130
what?

125
00:07:38,130 --> 00:07:38,950
You're going to ideas.

126
00:07:38,970 --> 00:07:39,810
Open up your code.

127
00:07:40,230 --> 00:07:44,880
So what I was just doing is creating an empty folder somewhere that's accessible on your computer,

128
00:07:44,880 --> 00:07:46,980
like desktop documents or downloads.

129
00:07:47,250 --> 00:07:51,360
And then what you can do is start actually coding out in that folder.

130
00:07:51,600 --> 00:07:56,310
Or if you want, you can download the zip file of all the code that's included for this course and just

131
00:07:56,310 --> 00:07:57,030
connect to that.

132
00:07:57,060 --> 00:08:00,930
So typically, what's going to do is say, click here, pick a folder and then we'll go.

133
00:08:00,930 --> 00:08:04,050
Here is just go to my desktop and maybe I'll make a new folder here.

134
00:08:04,770 --> 00:08:10,380
So I'm going to call this new folder, and let's call this Django lectures.

135
00:08:12,720 --> 00:08:16,740
And so as I'm quoting along with you, I'll just go ahead and put everything in here, so I'll select

136
00:08:16,740 --> 00:08:17,360
that folder.

137
00:08:18,390 --> 00:08:18,990
There we go.

138
00:08:19,380 --> 00:08:21,720
And then do I trust the authors of this file?

139
00:08:21,750 --> 00:08:22,530
Yes, it's me.

140
00:08:22,560 --> 00:08:24,000
So I just trust everybody.

141
00:08:24,330 --> 00:08:25,690
So yes, I trust the authors.

142
00:08:25,710 --> 00:08:27,570
You may want to change this if you're on a work computer.

143
00:08:27,990 --> 00:08:30,990
And then we can do here is just start making files and folders.

144
00:08:30,990 --> 00:08:35,760
So you can see here there's a little new file button as well as a new folder button.

145
00:08:36,090 --> 00:08:37,950
We'll be exploring this later on with Django.

146
00:08:37,950 --> 00:08:41,610
It actually has a lot of features for us to automatically create directory structures.

147
00:08:42,000 --> 00:08:47,160
But the other thing we should keep in mind is that there's also a terminal capability so we can click

148
00:08:47,160 --> 00:08:47,910
new terminal.

149
00:08:48,870 --> 00:08:52,410
And I'll open a terminal down here at the bottom.

150
00:08:52,710 --> 00:08:55,140
You'll notice by default that uses PowerShell.

151
00:08:55,380 --> 00:08:59,530
Depending on how you've installed Python, sometimes PowerShell has issues with that.

152
00:08:59,580 --> 00:09:04,710
So if you want, you can always change where this is actually coming from and you can connect it to

153
00:09:04,710 --> 00:09:05,550
the command prompt.

154
00:09:06,550 --> 00:09:12,910
And you do that by clicking on the little dropdown arrow and you can hear command prompt, you may also

155
00:09:12,910 --> 00:09:16,750
see other options depending on what you're running the command prompt there.

156
00:09:17,050 --> 00:09:21,370
And just to make sure everything's working from your original installation of Python, you should be

157
00:09:21,370 --> 00:09:27,550
able to type Python here, enter and see that Python is running and then hit something like one plus

158
00:09:27,550 --> 00:09:29,220
one and get an output.

159
00:09:29,230 --> 00:09:31,990
And then if you want to quit Python, say, quit there.

160
00:09:32,200 --> 00:09:34,120
And if you're a windows, you want to clear this screen.

161
00:09:34,120 --> 00:09:35,140
It's seals.

162
00:09:35,500 --> 00:09:38,950
If you are on Mac OS or Linux, it's just the keyword clear.

163
00:09:39,940 --> 00:09:44,410
And then what you can do is as you install more libraries, you can set up a virtual environment or

164
00:09:44,410 --> 00:09:49,030
you can just say something like PIP, Install, Django, Hit, Enter, and then that's going to set

165
00:09:49,030 --> 00:09:50,380
up everything for installing.

166
00:09:50,380 --> 00:09:52,060
And it looks like it's actually running for me right now.

167
00:09:52,330 --> 00:09:56,350
But you get the idea it's up to you, whether you want to set up a virtual environment, we'll talk

168
00:09:56,350 --> 00:09:57,430
about that more later on.

169
00:09:57,700 --> 00:10:02,080
The main thing here that I want you to be feeling comfortable with is the fact that you can easily call

170
00:10:02,080 --> 00:10:05,830
a terminal at the bottom of this coding ED.

171
00:10:05,830 --> 00:10:09,460
And then when you want to run a file, you can just create a new file here.

172
00:10:09,460 --> 00:10:18,070
So I can say something like create a new file and then call this my file that I enter and you can see

173
00:10:18,070 --> 00:10:24,940
I'm starting to code inside my file that pie and you'll notice as you start creating this python, file

174
00:10:25,390 --> 00:10:28,030
the editor smart enough to detect, Hey, this is Python.

175
00:10:28,060 --> 00:10:33,160
Maybe you want some recommendation like IntelliSense debugging, lynching and more.

176
00:10:33,190 --> 00:10:35,980
You should see that at the bottom unless you already have this installed.

177
00:10:36,310 --> 00:10:38,480
And I would actually recommend you install this.

178
00:10:38,500 --> 00:10:40,600
Essentially, this is just intelligent.

179
00:10:40,600 --> 00:10:44,500
Sensing is going to say, Hey, let me help autocomplete this function name or stuff like that.

180
00:10:44,860 --> 00:10:46,920
So I'll go ahead and install this.

181
00:10:46,930 --> 00:10:47,860
I'll click on install.

182
00:10:48,220 --> 00:10:52,750
This is the default Python extension for Visual Studio code actually comes from Microsoft.

183
00:10:53,050 --> 00:10:56,170
And by the time you click on that, it should already be installing.

184
00:10:56,560 --> 00:10:58,480
So I would recommend you install this.

185
00:10:58,510 --> 00:11:00,460
It makes working with Python a lot easier.

186
00:11:00,790 --> 00:11:03,790
But let's go ahead and make sure that everything is working.

187
00:11:03,820 --> 00:11:07,120
You can see here it's going to ask you about selecting your Python interpreter.

188
00:11:07,150 --> 00:11:11,740
We'll explore that later, and then you can also configure the debugger, tons of features, tests,

189
00:11:11,740 --> 00:11:12,340
et cetera.

190
00:11:12,790 --> 00:11:17,680
And if you don't have Python install already, there's actually steps here to install Python.

191
00:11:17,710 --> 00:11:22,270
So in case you have an installed python, go ahead and click here to install Python, and it should

192
00:11:22,270 --> 00:11:23,500
set everything up for you.

193
00:11:23,800 --> 00:11:25,870
And there's step by step instructions right here.

194
00:11:26,230 --> 00:11:31,270
You can also then select a Python interpreter running Debug Your Python file, et cetera, on my computer.

195
00:11:31,330 --> 00:11:34,540
I already have all this set up, so I don't need to go through the Python installation.

196
00:11:34,840 --> 00:11:39,160
If you're totally new to Python, if for some reason you don't have it on this computer, it's actually

197
00:11:39,160 --> 00:11:42,220
pretty nice to install it all from Visual Studio code.

198
00:11:42,270 --> 00:11:43,390
Just the easiest way to do it.

199
00:11:43,660 --> 00:11:49,900
But let's make sure everything's working going to come to you, my file, and I'm going to zoom in just

200
00:11:50,110 --> 00:11:52,510
a little bit here so you can see things.

201
00:11:52,750 --> 00:11:58,090
And then I'm going to I'm actually going to clear my terminal source type cluster on my terminal.

202
00:11:58,450 --> 00:12:00,280
Analysts have this, say Prince.

203
00:12:02,190 --> 00:12:07,050
Working, make sure you save this, so you have this little dot here telling you if it's say they're

204
00:12:07,050 --> 00:12:07,560
unsafe.

205
00:12:07,860 --> 00:12:12,150
Probably one of my most personal common mistakes is I just forget to save my changes and I'm scratching

206
00:12:12,150 --> 00:12:13,380
my head thinking, What's not working?

207
00:12:13,390 --> 00:12:15,930
So just do a control s or command.

208
00:12:15,930 --> 00:12:21,210
That's the save that and you'll notice we're actually in the same location Django lectures as this files

209
00:12:21,210 --> 00:12:24,000
in so I can come here and simply say Python.

210
00:12:25,410 --> 00:12:28,140
My file that pie enter.

211
00:12:28,470 --> 00:12:30,390
It's working, so we're good to go.

212
00:12:30,870 --> 00:12:35,580
OK, so we've installed the actual Visual Studio Code Editor will be using for the course.

213
00:12:35,850 --> 00:12:40,080
We've set up a folder that we can play around with, create directories, files and more.

214
00:12:40,290 --> 00:12:45,690
We understood that we have the ability to run a terminal in the actual coding environment.

215
00:12:45,990 --> 00:12:49,560
And then we also check to make sure Python is working within the coding environment.

216
00:12:49,800 --> 00:12:52,590
And you can install it if you don't have it yet.

217
00:12:52,710 --> 00:12:55,650
So that's pretty much it for this lecture.

218
00:12:55,680 --> 00:13:00,030
Again, if you want to change things like colors and themes, you can always explore those further along.

219
00:13:00,210 --> 00:13:02,610
But right now, we'll just keep everything as it is.

220
00:13:02,910 --> 00:13:03,270
OK.

221
00:13:03,480 --> 00:13:03,880
Thanks.

222
00:13:03,950 --> 00:13:04,890
I'll see you at the next lecture.

