Member-only story
Make your Django REST API 10 times faster with Redis.
Implementing REST API in Django is easy. In this tutorial, we will create a basic DRF project and add Redis.
What Is Redis
Redis is a key-value, in-memory database with TTL features and more. One Of its Amazing features is TTL(Time To Live). TTL means we can set how many seconds the data will be live in Redis.
Redis Setup
To set up Redis in Windows, please refer to this document. You will find a step-by-step tutorial on how to install and run Redis on your local machine (https://medium.com/@priyankdesai515/install-redis-on-windows-10-fda2472bf195).
Source code
If you just want the source code, you can get it here.(https://github.com/Priyank010/Django-Redis).
Django Project.
Once the Redis set up is done, it’s now time to start the Django project. Start by creating the python environment.
pip install virtualenv
virtualenv MyFirstApp
MyFirstApp\scripts\activate
Inside that install Django, Django REST framework, and Django Core headers in it.
pip install django djangorestframework django-cors-headers