WEBVTT
Kind: captions
Language: en

00:00:00.160 --> 00:00:06.380
Next we're going to install the required
Python packages that we need for our

00:00:06.440 --> 00:00:12.320
project we're going to be installing two
packages one is Django and the second is

00:00:12.330 --> 00:00:15.420
the Django rest framework

00:00:15.420 --> 00:00:18.330
it's best
practice to list all of the required

00:00:18.330 --> 00:00:25.260
packages for a particular Python project
in a file called requirements dot txt so in

00:00:25.260 --> 00:00:29.960
our project let's create a new file and
let's call the file requirements dot txt

00:00:31.940 --> 00:00:35.840
and this is where we list all the
required Python packages and the

00:00:35.850 --> 00:00:39.720
specific version we need for our project

00:00:39.720 --> 00:00:41.610
the first package we're going to add is

00:00:41.610 --> 00:00:48.890
Django so just type the word Django and
then two equal signs and then version

00:00:48.890 --> 00:00:50.900
2.2

00:00:50.900 --> 00:00:54.510
so if you didn't specify the equal
signs then it would just install the

00:00:54.510 --> 00:00:58.859
latest version available and this isn't
always recommended because sometimes

00:00:58.859 --> 00:01:03.690
there may be updates to a Python package
that break your project so it's always

00:01:03.690 --> 00:01:09.240
best to pin to a specific version of the
requirement that you want to install the

00:01:09.240 --> 00:01:14.040
next requirement we're going to install
is Django rest framework so lets type

00:01:14.040 --> 00:01:19.470
Django rest framework equal equal and
we're going to install Version three

00:01:19.470 --> 00:01:27.570
point nine point two and then save the
requirements file and these versions of

00:01:27.570 --> 00:01:32.009
these requirements are the latest at the
time that I'm recording the videos I

00:01:32.009 --> 00:01:36.240
recommend that you stick with these
versions until the end of the course and

00:01:36.240 --> 00:01:40.259
then if you wanted to update them to the
latest version after the course you can

00:01:40.259 --> 00:01:46.649
do that by heading over to the Python
package index website pypi.org and

00:01:46.649 --> 00:01:51.479
searching for the requirement that you
want to find out the version for so you

00:01:51.479 --> 00:01:56.280
can see here this is the search for
Django and Django here is currently a

00:01:56.280 --> 00:02:05.610
version 2.2 now let's search for Django
rest framework and you can see the

00:02:05.610 --> 00:02:09.569
latest version of Django rest framework
is three point nine point two so we have

00:02:09.569 --> 00:02:13.770
the latest current version ok so make
sure the requirements file is

00:02:13.770 --> 00:02:18.680
saved and now we're going to go ahead
and connect to our vagrant server and

00:02:18.680 --> 00:02:23.560
install the requirements in our virtual
environment

00:02:23.560 --> 00:02:24.800
okay so make sure that

00:02:24.810 --> 00:02:29.940
you're in the forward slash vagrant
directory and that you have activated

00:02:29.940 --> 00:02:34.230
the virtual environment so if it's not
activated and you don't see this env then

00:02:34.230 --> 00:02:40.170
just type source tilde forward slash
env forward slash bin forward slash

00:02:40.170 --> 00:02:45.030
activate and now we can install the
requirements directly from our

00:02:45.030 --> 00:02:51.750
requirements dot txt file by typing pip
install - r that stands for

00:02:51.750 --> 00:02:57.660
requirements and then requirements dot
txt and then if we hit enter it will go

00:02:57.660 --> 00:03:01.530
ahead and install each one of the
requirements listed in our requirements

00:03:01.530 --> 00:03:04.520
dot txt file

00:03:04.520 --> 00:03:08.460
okay so that's how you
install the requirements and list them

00:03:08.460 --> 00:03:12.020
in a file with our project

