This project is a practical implementation of JWT-based authentication in Django Rest Framework (DRF) using SimpleJWT. This project is designed to demonstrate how to build a secure authentication system with JWT and handle token storage in HttpOnly cookies.
- English: Securing Django Rest Framework with JWT Authentication in HttpOnly Cookie - Part 1
- Persian: افزایش امنیت API با استفاده از JWT و کوکی HttpOnly در Django Rest - بخش اول
- English: Securing Django Rest Framework with JWT Authentication in HttpOnly Cookie - Part 2
- Persian: افزایش امنیت API با استفاده از JWT و کوکی HttpOnly در Django Rest - بخش دوم
Follow these steps to set up and run the project locally:
Before running the project, ensure you have the following installed:
- Docker
- Docker Compose
Clone the project repository to your local machine:
git clone https://github.com/mobinghoveoud/drf-jwt-httponly-cookie.git
cd drf-jwt-httponly-cookie
Copy the .env.example
file to .env
and complete the values as necessary:
cp .env.example .env
Make sure to configure sensitive information like secret keys, database credentials, etc.
Now, use Docker Compose to start the application:
docker-compose up
This will start the Django application and all necessary services.
Once the Docker containers are running, you can access the API at http://localhost:8000/
.
Feel free to contribute, report issues, or leave feedback through GitHub issues or the comment section of the articles.