Skip to content

harshit447/Social_Media_Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social_Media_Api

This repository contains a REST API built with Python Django and Django REST Framework. It allows users to create an account, log in, and perform CRUD (Create, Read, Update, Delete) operations on posts and comments.

Installation

Clone this repository to your local machine

Navigate to the project directory.

cd Social_Media_Api

Install the required dependencies.

pip install -r requirements.txt

Run the server.

python manage.py runserver

The server will be running at http://127.0.0.1:8000/.

API Endpoints

Authentication

api/auth/register/ -

Register a new user account

api/auth/login/ -

Obtain a JWT token by passing a valid username and password

Posts

api/posts/ -

List all posts or create a new post (requires authentication)

api/posts/{id}/ -

Retrieve, update or delete a specific post by ID (requires authentication)

api/posts/{id}/like/ -

Like or unlike a specific post by ID (requires authentication)

Comments

api/posts/{id}/comments/ -

List all comments for a specific post or create a new comment (requires authentication)

api/posts/{id}/comments/{id}/ -

Retrieve, update or delete a specific comment by ID (requires authentication)