Next we're going to install the required Python packages that we need for our
project we're going to be installing two packages one is Django and the second is
the Django rest framework
it's best practice to list all of the required
packages for a particular Python project in a file called requirements dot txt so in
our project let's create a new file and let's call the file requirements dot txt
and this is where we list all the required Python packages and the
specific version we need for our project
the first package we're going to add is
Django so just type the word Django and then two equal signs and then version
2.2
so if you didn't specify the equal signs then it would just install the
latest version available and this isn't always recommended because sometimes
there may be updates to a Python package that break your project so it's always
best to pin to a specific version of the requirement that you want to install the
next requirement we're going to install is Django rest framework so lets type
Django rest framework equal equal and we're going to install Version three
point nine point two and then save the requirements file and these versions of
these requirements are the latest at the time that I'm recording the videos I
recommend that you stick with these versions until the end of the course and
then if you wanted to update them to the latest version after the course you can
do that by heading over to the Python package index website pypi.org and
searching for the requirement that you want to find out the version for so you
can see here this is the search for Django and Django here is currently a
version 2.2 now let's search for Django rest framework and you can see the
latest version of Django rest framework is three point nine point two so we have
the latest current version ok so make sure the requirements file is
saved and now we're going to go ahead and connect to our vagrant server and
install the requirements in our virtual environment
okay so make sure that
you're in the forward slash vagrant directory and that you have activated
the virtual environment so if it's not activated and you don't see this env then
just type source tilde forward slash env forward slash bin forward slash
activate and now we can install the requirements directly from our
requirements dot txt file by typing pip install - r that stands for
requirements and then requirements dot txt and then if we hit enter it will go
ahead and install each one of the requirements listed in our requirements
dot txt file
okay so that's how you install the requirements and list them
in a file with our project