A modern full-stack blog application built using Django REST Framework (DRF) and vanilla JavaScript with Bootstrap 5.
Users can register, login, create/edit/delete posts, like posts, and comment with proper user-based access control.
- User Registration & Token-based Login
- Create, Read, Update, Delete (CRUD) for Blog Posts
- Like / Unlike Posts
- Comment on Posts
- Edit / Delete Your Own Comments
- Only post/comment owners can edit/delete their content
- Responsive and modern UI using Bootstrap 5
- Python 3
- Django
- Django REST Framework
- Django Token Authentication
- HTML5 + CSS3
- Bootstrap 5
- JavaScript (Vanilla)
git clone https://github.com/mohdbasi/fullstack-blog-app
cd blog-projectpython -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
- Pages are rendered directly via Django templates.
- Frontend is located in:
templates/frontend/ (HTML)static/frontend/ (JavaScript)
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/register/ |
Register new user |
| POST | /api/login/ |
Login user and get token |
| POST | /api/logout/ |
Logout and destroy token |
| GET | /api/posts/ |
List all posts |
| POST | /api/posts/ |
Create a new post |
| PUT | /api/posts/<id>/ |
Update a post (owner only) |
| DELETE | /api/posts/<id>/ |
Delete a post (owner only) |
| POST | /api/posts/<id>/like/ |
Toggle like on a post |
| GET | /api/posts/<id>/comments/ |
List all comments for a post |
| POST | /api/posts/<id>/comments/ |
Create comment for a post |
| PUT | /api/comments/<id>/ |
Edit comment (owner only) |
| DELETE | /api/comments/<id>/ |
Delete comment (owner only) |