Django REST Frameworks
Django REST Frameworks popularly known as DRP is a package within the Django framework used to build Web APIs. Using this framework your work to create REST API yourself is eliminated.
Prerequisites:
- Python (3.6, 3.7, 3.8, 3.9, 3.10)
- Django (2.2, 3.0, 3.1, 3.2, 4.0, 4.1)
Features:
- The usage of Django REST Frameworks makes serialization easier.
- Compatible with both ORM and non-ORM data sources.
- Provides generic classes for performing CRUD operations in a hassle-free manner.
- Creation of REST API endpoints is fastened.
Configuration:
One way of installing the REST framework is pip install. Run the following command on your terminal:
pip install djangorestframework
REST framework can also be installed using the source code on GitHub. Download source code:
git clone https://github.com/encode/django-rest-framework
After installing the package either way mentioned above, add rest_framework to INSTALLED_APPS in the settings.py file:
INSTALLED_APPS = [
# Other installed apps
'rest_framework'
]
Top 10 Django Packages Every Developer Should Know
Python is one of the most popular languages for web development nowadays. It has various frameworks like Django, Flask, Hug, CherryPy, and Bottle that help developers write web applications in Python. Among all the frameworks Django is the most used framework to create websites in Python.
Django is an open-source and free-to-use full-stack web framework. It has several built-in libraries that support MySQL, SQLite, PostgreSQL, and Oracle as databases. It is a secure, stable, and scalable framework that helps us to create useful applications that are secure, stable, and scalable just like the framework.