Skip to content
Related Articles

Related Articles

Improve Article

Django REST Framework Installation

  • Last Updated : 05 Oct, 2021
Geek Week

Django REST Framework can be installed via pip package similar to Django installation. Since Django REST Framework is a wrapper over default Django Framework, to install it, Django should be installed already. Now to install rest framework follow the below process.

Prerequisites

  • Python
  • Pip
  • Django

    How to install Django REST Framework

    To install Django REST Framework on Windows, Linux or any operating system, one would need pip package. To check how to install pip on your operating system, checkoout – PIP Installation – Windows || Linux.
    Now, run a simple command,

    pip install djangorestframework

    Wait and relax, REST framework would be installed shortly.
    django-rest-framework-installation

    Install Django REST Framework using Source code

    One can install Django REST Framework, using source code directly, install git command line utlity first, then

    git clone https://github.com/encode/django-rest-framework

    after cloning, it add it to bin directory where django is installed.



    Add rest_framework to INSTALLED_APPS

    For Django REST Framework to work on top of Django, you need to add rest_framework in INSTALLED_APPS, in settings.py.

    INSTALLED_APPS = (
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'rest_framework'
    )
    

    Bingo..!! Django REST Framework is successfully installed, one case use it in any app of Django.

     Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

    To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

    My Personal Notes arrow_drop_up
Recommended Articles
Page :