This is the backend for a personal blogging project built with Django. It provides a RESTful API for managing blog posts, user authentication, and other features.
- User authentication and authorization
- CRUD operations for blog posts
- Comment system
- Tagging system
- Pagination for blog posts
- Admin interface for managing content
- Python 3.13+
- Django 5+
- Django REST Framework
-
Clone the repository:
git clone https://github.com/AfshanAlamEngg/coco-blogs-backend cd coco-blogs-backend -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activateIf the above code not works, then try the below code.
python -m venv venv source venv/Scripts/activate -
Install the dependencies:
pip install -r requirements.txt
-
Run the migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
You can access the API endpoints using tools like Postman or cURL. The admin interface can be accessed at /admin/.
GET /api/posts/- List all blog postsPOST /api/posts/- Create a new blog postGET /api/posts/{id}/- Retrieve a specific blog postPUT /api/posts/{id}/- Update a specific blog postDELETE /api/posts/{id}/- Delete a specific blog postPOST /api/comments/- Add a comment to a blog post
Contributions are welcome! Please open an issue or submit a pull request for any improvements or new features.
This project is licensed under the MIT License. See the LICENSE file for more details.
