π A Powerful Django REST API with JWT Authentication, Search, Filtering, Ordering, Pagination & Throttling
This project is a RESTful API built with Django REST Framework (DRF).
It provides a clean and secure API for managing books with modern backend features including:
- π Search
- π Filtering
βοΈ Ordering- π Pagination
- π JWT Authentication
- π¦ API Throttling
- π‘οΈ Permission Control
The API is designed following REST principles and can easily be integrated with Web, Mobile or Desktop applications.
β JWT Authentication
β CRUD Operations
β Search by Title
β Filter by Author
β Order by Price
β Pagination
β API Throttling
β Secure Permissions
β RESTful API
| Technology | Description |
|---|---|
| Python | Programming Language |
| Django | Web Framework |
| Django REST Framework | REST API Development |
| Simple JWT | Authentication |
| SQLite | Database |
| Django ORM | Database Operations |
| REST API | Backend Architecture |
Clone the repository
git clone https://github.com/iamdeveloperrayhan/REST-API.gitGo to project
cd REST-APICreate Virtual Environment
python -m venv venvActivate
venv\Scripts\activatesource venv/bin/activateInstall required packages
pip install djangopip install djangorestframeworkpip install djangorestframework-simplejwtpip install django-filterOr
pip install -r requirements.txtpython manage.py makemigrationspython manage.py migrateCreate Superuser
python manage.py createsuperuserpython manage.py runserverVisit
http://127.0.0.1:8000/
http://127.0.0.1:8000/api/
Register a new account
POST /register/
Replace the URL according to your project.
Login
POST /login/
Receive
Access Token
Refresh Token
Send Access Token
Authorization
Bearer YOUR_ACCESS_TOKEN
If you don't have an account,
Register first
β
Login
β
Receive JWT Token
β
Access Protected APIs
| Method | Permission |
|---|---|
| GET | AllowAny |
| POST | IsAuthenticated |
| PUT | IsAuthenticated |
| PATCH | IsAuthenticated |
| DELETE | IsAuthenticated |
Search by Title
Query Parameter
title
Example
/api/books/?title=django
Internally this project uses
Q()
with
|
(Pipe Operator)
for searching.
Filter books by Author
Example
/api/books/?author=John
Order books by Price
Query Parameter
order
Example
Ascending
/api/books/?order=price
Descending
/api/books/?order=-price
Uses
.order_by()Pagination is enabled.
Every page returns
2 Books
Example
?page=2
| User Type | Requests |
|---|---|
| Authenticated User | 50 Requests / Minute |
| Anonymous User | 20 Requests / Minute |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/books/ |
Get All Books |
| GET | /api/books/<id>/ |
Get Single Book |
| POST | /api/books/ |
Create Book |
| PUT | /api/books/<id>/ |
Update Entire Book |
| PATCH | /api/books/<id>/ |
Partial Update |
| DELETE | /api/books/<id>/ |
Delete Book |
POST /api/books/
Content-Type: application/json
{
"title": "title",
"author": "author",
"price": 100
}Response
{
"id":1,
"title":"title",
"author":"author",
"price":"100.00",
"published_date":"2026-07-08T12:50:33.721511Z"
}PATCH /api/books/5/
{
"price":170
}Response
{
"id":5,
"title":"title",
"author":"author",
"price":"170.00",
"published_date":"2026-07-08T12:50:33.721511Z"
}REST_API_Framework/
β
βββ REST_MAIN/
β βββ migrations/
β βββ __init__.py
β βββ admin.py
β βββ apps.py
β βββ models.py
β βββ stabilizer.py
β βββ tests.py
β βββ views.py
β
βββ db.sqlite3
βββ manage.py
βββ README.md
βββ requirements.txt
- Swagger Documentation
- API Versioning
- Docker Support
- PostgreSQL
- Redis Cache
- Celery
- Unit Testing
- CI/CD Pipeline
- Production Deployment
Full Stack Developer
π Portfolio
GitHub
https://github.com/iamdeveloperrayhan
https://linkedin.com/in/iamdeveloperrayhan
https://facebook.com/iamdeveloperrayhan
iamdeveloperrayhan@gmail.com
If you like this project,
β Star this repository
Fork it
Share it
This project is licensed under the MIT License.