A RESTful blog backend built with Django and Django REST Framework. The project includes blog and category management, token-based authentication, user registration, filtering, search and pagination.
- Blog CRUD API
- Category CRUD API
- User registration
- Token-based login and authentication
- Read-only access for anonymous users
- Authenticated write access for blog content
- Staff-only write access for categories
- Search across blog title and content
- Category filtering
- Page-number pagination
- Python
- Django 4
- Django REST Framework
- django-filter
- Token Authentication
- SQLite
| Endpoint | Purpose |
|---|---|
/api/blog/ |
List, create, retrieve, update and delete blog posts |
/api/category/ |
List and manage categories |
/user/register/ |
Register a user |
/user/login/ |
Obtain an authentication token |
/admin/ |
Django admin |
Blog posts can be filtered by category:
/api/blog/?category=1
Blog posts can be searched by title or content:
/api/blog/?search=django
Categories can be filtered by name:
/api/category/?name=Backend
- Blog endpoints are readable by everyone.
- Creating, updating and deleting blog posts requires authentication.
- Category endpoints are readable by everyone, while write operations require a staff user.
git clone https://github.com/omersb/Blog_App-django.git
cd Blog_App-djangomacOS / Linux:
python3 -m venv venv
source venv/bin/activateWindows:
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root:
SECRET_KEY=your-django-secret-keypython manage.py migratepython manage.py createsuperuserpython manage.py runserverThe API will be available at:
http://127.0.0.1:8000/
After registering a user, obtain a token from:
POST /user/login/
Authenticated API requests use DRF token authentication:
Authorization: Token <your-token>Blog_App-django/
├── blog/ # Blog and category API
├── user/ # Registration and login
├── main/ # Django project configuration
├── manage.py
└── requirements.txt
Ömer Said Bulduk
- Portfolio: https://omersb.dev/
- GitHub: https://github.com/omersb
- LinkedIn: https://www.linkedin.com/in/omersaidbulduk/
