https://github.com/ananthakrishnan12/blog-api-django
🚀 Django REST API for a Blog – A backend API for managing blog posts, including authentication, pagination, throttling, and CRUD operations using Django Rest Framework (DRF).
https://github.com/ananthakrishnan12/blog-api-django
django-rest-framework djnago-filters models pagination postman python3 serialization throttling token-based-authentication views
Last synced: about 2 months ago
JSON representation
🚀 Django REST API for a Blog – A backend API for managing blog posts, including authentication, pagination, throttling, and CRUD operations using Django Rest Framework (DRF).
- Host: GitHub
- URL: https://github.com/ananthakrishnan12/blog-api-django
- Owner: Ananthakrishnan12
- Created: 2025-02-09T13:19:58.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-09T15:04:41.000Z (3 months ago)
- Last Synced: 2025-02-09T15:27:38.960Z (3 months ago)
- Topics: django-rest-framework, djnago-filters, models, pagination, postman, python3, serialization, throttling, token-based-authentication, views
- Language: Python
- Homepage:
- Size: 37.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blog-API-Django
This is a RESTful API for a blog platform built using Django and Django Rest Framework (DRF).
It provides endpoints for managing blog posts, user authentication, pagination, and request throttling.## Features
- 🔹 **CRUD Operations**: Create, Read, Update, and Delete blog posts.
- 🔹 **User Authentication**: Token-based authentication using DRF.
- 🔹 **Pagination**: Efficiently fetch blog posts with paginated results.
- 🔹 **Throttling**: Rate limit requests to prevent abuse.
- 🔹 **Filtering & Searching**: Retrieve blog posts based on different criteria.## Tech Stack
- **Backend**: Django, Django Rest Framework (DRF)
- **Database**: SQLite
- **Authentication**: DRF Token Authentication## Database Model
### BlogPost
The **BlogPost** model represents a blog post created by a user.#### Fields:
- **title** (*CharField*): Stores the blog post title (max length: 100).
- **content** (*TextField*): Contains the blog content.
- **author** (*ForeignKey to User*): Links the post to a registered user.
- **created_at** (*DateTimeField*): Automatically records when the post was created.
- **updated_at** (*DateTimeField*): Automatically updates when the post is modified.
- **is_published** (*BooleanField*): Defines whether the post is published (default: `False`).
- **total_likes** (*IntegerField*): Stores the number of likes on the post (default: `0`).---
### Comment
The **Comment** model allows users to leave comments on a blog post.#### Fields:
- **comment_user** (*ForeignKey to User*): The user who commented.
- **likes** (*PositiveIntegerField*): Tracks likes (either `0` or `1`, using validators).
- **comments** (*TextField*): Stores the actual comment text.
- **blogpost** (*ForeignKey to BlogPost*): Links the comment to a specific blog post.
- **created** (*DateTimeField*): Timestamp when the comment was created.
- **updated** (*DateTimeField*): Timestamp when the comment was last updated.# API Testing Tool: 🔬 POSTMAN
# Endpoints: (with Demo Gif) wait for a few seconds...
- **Register**
- **Login**
- **Post Create & Get (List)**
- **Post Comment Create & Get (List)**
- **Logout**
# FrontEnd Integration : In Progress...