The Django Blogging Platform API is a powerful and flexible RESTful API built on the Django framework and Django Rest Framework (DRF). The primary goal of this project is to provide a robust backend solution for a modern blogging platform. The API supports essential functionalities such as user registration, authentication, and authorization, allowing users to create, read, update, and delete blog posts seamlessly
- User Registration: New users can effortlessly register by providing necessary details (username and password).
- User Login: Existing users can securely log in to the platform.
- JWT Authentication: The API implements JSON Web Token (JWT) authentication to ensure secure user sessions.
- Permissions: only users who have authorize permissions can create read update and delete a post.
- Create Posts: Authenticated and authorized users can craft engaging blog posts by providing a title,content and author.
- Read Posts: Authenticated and authorized users can retrieve blog posts.
- Update Posts: Authenticated and authorized users have the ability to edit the content and title of their own blog posts.
- Delete Posts: Authenticated and authorized users users can delete their own blog posts.
The project includes a well-defined data model that represents blog posts. Each post comprises a title, content, author, and a timestamp for tracking post creation.
The API adheres to RESTful principles with clear and concise endpoints for user authentication and blog post management.
Python 3.9 Django 5.0.1
- Clone the Repository:
git clone https://github.com/BINAH25/talent_sync_assessment.git cd talent_sync_assessment
- Create Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
- Install the requires packages:
cd assessment pip install -r requirements.txt python manage.py makemigrations python manage.py migrate
- User registration endpoint:
http://127.0.0.1:8000/api/sign_up/
- User login endpoint:
http://127.0.0.1:8000/api/login/
- Create post and get all posts endpoint:
http://127.0.0.1:8000/api/post/
- get a post endpoint:
http://127.0.0.1:8000/api/post/post_id/ (e.g http://127.0.0.1:8000/api/post/1/)
- update a post endpoint:
http://127.0.0.1:8000/api/post/post_id/ (e.g http://127.0.0.1:8000/api/post/1/)
- delete a post endpoint:
http://127.0.0.1:8000/api/post/post_id/ (e.g http://127.0.0.1:8000/api/post/1/)
- assign and revoke a user permission endpoint:
http://127.0.0.1:8000/api/post/assign-permissions/ http://127.0.0.1:8000/api/post/revoke-permissions/