Instagram
youtube
Facebook
Twitter

How to install the Django REST Framework.

In this tutorial, we'll learn about how to install the Django REST Framework (DRF).

Prerequisites

Before installing DRF, make sure you have Python and pip (Python package manager) installed on your system.

Install Django

The Django REST Framework (DRF) is built on the Django web framework. So, before installing DRF, we have to install Django. You can use the command given below in your terminal to install Django.

pip install django

Install Django REST Framework

Now Django is installed on our system. To install the Django REST Framework, use the command given below.

pip install djangorestframework

Verify Installation

To verify that Django REST Framework is successfully installed, you can run the following command

pip show djangorestframework

Add Django REST Framework to your Django project

To start using DRF we need to add it to the project's settings. Open project's settings file and add 'rest_framework' to the INSTALLED_APPS list:

INSTALLED_APPS = [
    ...
    'rest_framework',
    ...
]

Django and the Django REST Framework are successfully installed on our system. Now we can use them.