This will be the introduction to a series of articles about the django restframework. In this article you will get an overview and it is meant as an entry point to the other articles on the framework. I hope that will help to get a better understanding on that superb piece of code that is highly appreciated in order to turn django into a backend api for your webapplication.
What is it for?
The restframework is for building browsable APIs with Django. For many developers today this is the preferred way to go:
- use django as a backend
- the interface between frontend and backend is a django API
Django restframework is more than an API
It is a browsable api with forms to input the data.
In that way it can also be used to administer your data and can replace the django admin. It comes with a lot of power.
You can get a first impression with the quickstart tutorial.
Components of the framework
The restframework consists of several components: I will write a detailed tutorial how to use and understand each of these components and put the link in as soon as my articles get ready:
- Serializers: they serialize and deserialize data coming from a database or from other sources. The data si serialized to a JSON-Format, which is a common api-data-format. It is deserialized in order to be ready to be saved the a database backend via the django database abstractions layer, its ORM:
Basics on the Serialization with the django restframework
- Request objects:
- Response object:
- API-wrappers: for both function and class based views
- Authentication and Permisson Systems: