...

/

Installations

Installations

Learn how to install the different libraries, frameworks, and tools used in this course on your machine.

Installing Django

There are two ways to install packages in Python. You can easily just run:

Press + to interact
pip install package_name

Alternatively, you can write the package name with the version in a text file.

Note: This section is only required if you are creating the project locally on your machine.

Just know that there can be some differences between the version and it can affect your project.

Create a file named requirements.txt at the root of the django-api directory and add the Django package name:

Django==4.0
requirements.txt

Now, run the following command to install Django:

Press + to interact
pip install -r requirements.txt

Installing Postgres

Note: This section is only required if you are creating the project locally on your machine.

Depending to your OS, you can download different Postgres versions on the Postgres website. In this course, we are working with PostgreSQL 14.

Once you have installed Postgres from the link above, install a PostgreSQL adapter for Python, psycopg:

Press + to interact
pip install psycopg2-binary

Don’t forget to add this to the requirements.txt file:

Django==4.0
psycopg2_binary==2.9.2
The requirements.txt file

Installing Django Rest Framework and JWT authentication plugin

Note: This section is only required if you are creating the project locally on your machine.

The DRF package can be installed with this command:

Press + to interact
pip install djangorestframework django-filter

Don’t forget to add the following to the requirements.txt file:

Django==4.0
psycopg2_binary==2.9.2
djangorestframework==3.13.1
django-filter==21.1
The requirements.txt file

Installing package for JWT authentication

...