Skip to content

About

A backend REST API developed using Django and Django REST Framework (DRF) with secure authentication, Searching, Filtering, Ordering, CRUD operations, and clean API design for modern web applications.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

📚 Django REST API Framework

🚀 A Powerful Django REST API with JWT Authentication, Search, Filtering, Ordering, Pagination & Throttling


Python Django DRF JWT SQLite REST API License


📖 Project Overview

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.


✨ Features

✅ JWT Authentication

✅ CRUD Operations

✅ Search by Title

✅ Filter by Author

✅ Order by Price

✅ Pagination

✅ API Throttling

✅ Secure Permissions

✅ RESTful API


🛠 Technology Stack

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

📂 Installation

Clone the repository

git clone https://github.com/iamdeveloperrayhan/REST-API.git

Go to project

cd REST-API

🐍 Virtual Environment Setup

Create Virtual Environment

python -m venv venv

Activate

Windows

venv\Scripts\activate

Linux / macOS

source venv/bin/activate

📦 Package Installation

Install required packages

pip install django
pip install djangorestframework
pip install djangorestframework-simplejwt
pip install django-filter

Or

pip install -r requirements.txt

🗄 Database Migration

python manage.py makemigrations
python manage.py migrate

Create Superuser

python manage.py createsuperuser

▶️ Run Development Server

python manage.py runserver

Visit

http://127.0.0.1:8000/

📑 API Documentation

Base URL

http://127.0.0.1:8000/api/

🔐 JWT Authentication Flow

Step 1

Register a new account

POST /register/

Replace the URL according to your project.


Step 2

Login

POST /login/

Receive

Access Token

Refresh Token

Step 3

Send Access Token

Authorization

Bearer YOUR_ACCESS_TOKEN

👤 Registration & Login

If you don't have an account,

Register first

↓

Login

↓

Receive JWT Token

↓

Access Protected APIs


🔑 Permissions

Method Permission
GET AllowAny
POST IsAuthenticated
PUT IsAuthenticated
PATCH IsAuthenticated
DELETE IsAuthenticated

🔍 Search Functionality

Search by Title

Query Parameter

title

Example

/api/books/?title=django

Internally this project uses

Q()

with

|

(Pipe Operator)

for searching.


🎯 Filter

Filter books by Author

Example

/api/books/?author=John

↕️ Ordering

Order books by Price

Query Parameter

order

Example

Ascending

/api/books/?order=price

Descending

/api/books/?order=-price

Uses

.order_by()

📄 Pagination

Pagination is enabled.

Every page returns

2 Books

Example

?page=2

🚦 Throttling Configuration

User Type Requests
Authenticated User 50 Requests / Minute
Anonymous User 20 Requests / Minute

📌 API Endpoints

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

📬 Example Request

Create 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

PATCH /api/books/5/

{
    "price":170
}

Response

{
  "id":5,
  "title":"title",
  "author":"author",
  "price":"170.00",
  "published_date":"2026-07-08T12:50:33.721511Z"
}

📁 Project Structure

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

🚀 Future Improvements

  • Swagger Documentation
  • API Versioning
  • Docker Support
  • PostgreSQL
  • Redis Cache
  • Celery
  • Unit Testing
  • CI/CD Pipeline
  • Production Deployment

👨‍💻 Author

Developer Rayhan

Full Stack Developer

Connect With Me

🌐 Portfolio

GitHub

https://github.com/iamdeveloperrayhan

LinkedIn

https://linkedin.com/in/iamdeveloperrayhan

Facebook

https://facebook.com/iamdeveloperrayhan

Email


⭐ Support

If you like this project,

⭐ Star this repository

Fork it

Share it


📄 License

This project is licensed under the MIT License.

About

A backend REST API developed using Django and Django REST Framework (DRF) with secure authentication, Searching, Filtering, Ordering, CRUD operations, and clean API design for modern web applications.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages