🚀 An API that allows users to create blogs, comment, and interact with other users 🚀
- Table of Contents
- API Endpoints
- API Testing
- Overview
- Built With
- How To Use
- About This Project
- Key Features
- Contact
This API provides the following endpoints:
Method | URL | Explanation |
---|---|---|
POST | https://umit8114.pythonanywhere.com/users/register/ |
New user registration |
POST | https://umit8114.pythonanywhere.com/users/auth/login/ |
User login |
POST | https://umit8114.pythonanywhere.com/users/auth/logout/ |
User logout |
Method | URL | Explanation |
---|---|---|
GET | https://umit8114.pythonanywhere.com/blog/posts/ |
List all posts |
POST | https://umit8114.pythonanywhere.com/blog/posts/ |
Create a new post |
GET | https://umit8114.pythonanywhere.com/blog/posts/14/ |
Specific post details |
PUT | https://umit8114.pythonanywhere.com/blog/posts/14/ |
Post update |
DELETE | https://umit8114.pythonanywhere.com/blog/posts/16/ |
Post delete |
Method | URL | Explanation |
---|---|---|
GET | https://umit8114.pythonanywhere.com/blog/comments/ |
List post comments |
POST | https://umit8114.pythonanywhere.com/blog/comments/ |
Add a new comment |
Postman Collection contains the necessary requests to test each endpoint of your API. You can use it to quickly understand the functionality of the API.
To test APIs via Postman, you can follow the steps below:
- Install Postman (if not installed): Postman İndir.
- This Postman Collection download and import.
- Start testing APIs via Postman.
Postman Collection Link:
Blog App API Postman Collection
The Blog API application allows users to create blogs, comment, and interact with other users. This application provides:
- User authentication and authorization
- Blog CRUD operations
- Commenting and adding likes
- Using drf-nested-routers for hierarchical data model
Blog API uygulaması, kullanıcıların blog oluşturmasına, yorum yapmasına ve diğer kullanıcılarla etkileşim kurmasına olanak tanır. Bu uygulama şunları sağlar:
- Kullanıcı doğrulama ve yetkilendirme
- Blog CRUD işlemleri
- Yorum yapma ve beğeni ekleme
- Hiyerarşik veri modeli için drf-nested-routers kullanımı
➡ Testing user authentication processes with Postman.
➡ Testing CRUD operations on the Blog App API with Postman.
This project is built with the following tools and libraries:
- Django Rest Framework - A powerful framework for developing REST APIs.
- dj-rest-auth - User authentication and authorization.
- drf-nested-routers - Hierarchical routing.
To clone and run this application, you'll need Git
When installing the required packages in the requirements.txt file, review the package differences for windows/macOS/Linux environments.
Complete the installation by uncommenting the appropriate package.
requirements.txt dosyasındaki gerekli paketlerin kurulumu esnasında windows/macOS/Linux ortamları için paket farklılıklarını inceleyin.
Uygun olan paketi yorumdan kurtararak kurulumu gerçekleştirin.
# Clone this repository
$ git clone https://github.com/Umit8098/Project_Django_Rest_Framework_Blog_App_CH-12_V.02.git
# Install dependencies
$ python -m venv env
$ python3 -m venv env (for macOs/linux OS)
$ env/Scripts/activate (for win OS)
$ source env/bin/activate (for macOs/linux OS)
$ pip install -r requirements.txt
$ python manage.py migrate (for win OS)
$ python3 manage.py migrate (for macOs/linux OS)
# Create and Edit .env
# Add Your SECRET_KEY in .env file
"""
# example .env;
SECRET_KEY =123456789abcdefg...
"""
# Run the app
$ python manage.py runserver
- After cloning the app and installing the dependencies, you can follow these steps:
- Login Request:
- URL:
https://umit8114.pythonanywhere.com/users/auth/login/
- Method:
POST
- Body (JSON):
- URL:
{
"email": "umit@gmail.com",
"password": "umit123456"
}
- Post Create:
- URL:
https://umit8114.pythonanywhere.com/blog/posts/
- Method:
POST
- Headers:
- URL:
Authorization: Token <token key returned when logged in>
-
- Body (JSON):
{
"title": "fifth Post",
"content": "Second Content",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Sport_balls.svg/400px-Sport_balls.svg.png",
"is_published": true
}
- This is an API service for a blog application built with Django Rest Framework.
- Users can register, write blogs, comment on blogs and like them.
- Bu, Django Rest Framework ile oluşturulmuş bir blog uygulamasının API servisidir.
- Kullanıcılar kayıt olup, post yazabilir, yazılan postlara yorum yapabilir, beğeni yapabilirler.
- Blog Management: Users can write, update and delete blogs.
- Comment and Like: Can comment and add likes to blogs.
- User Authorization: User registration, login and profile management.
- Hierarchical Data Structure: Advanced data management with drf-nested-routers.
- Blog Yönetimi: Kullanıcılar blog yazabilir, güncelleyebilir ve silebilir.
- Yorum ve Beğeni: Bloglara yorum yapabilir ve beğeni ekleyebilir.
- Kullanıcı Yetkilendirme: Kullanıcı kayıt, giriş ve profil yönetimi.
- Hiyerarşik Veri Yapısı: drf-nested-routers ile gelişmiş veri yönetimi.
-
GitHub: @Umit8098
-
LinkedIn: @umit-arat