Django REST Framework is a library which works on top of Django. It can be called a Microframework. In django we return a HttpResponse object from views. But in DRF we return JSON object. DRF helps to create an  RESTful API endpoint. “Browsable API” was stated as the key factor in picking Django REST framework.

What is an API?

If you are totally new to development, you might have never heard about API. It’s totally okey. But did you ever think how data travel from one application to another?

API does that. It stands for Application Programming Interface. APIs transport data from one app to another. So, API is a messenger that takes request and returns the response or a software intermediary that allows two applications to talk to each other.

Think of a website that compares mobile phones of different brands. The site doesn’t have the information of each model of each brand in its database. Then how do they compare? Each time a user selects a mobile model, the backend of PhoneCompare site sends a request through the API to its manufacturer’s website to send information. If the request is valid the API comes with the response.

This is how it retrieves data and then compares them using it’s own mechanism.

Read More