A social media-like blog platform built using Django, allowing users to create, read, update, and delete blog posts with authentication features.
- ✅ User Authentication (Registration, Login, Logout)
- ✅ Blog Post Management (CRUD operations)
- ✅ User Profiles with bio and profile pictures
- ✅ Comments & Likes on posts
- ✅ Django Admin Panel for content management
- Implement user registration, login, and logout functionality using Django's built-in authentication system.
Create a Post model with the following fields:
title: CharFieldcontent: TextFieldauthor: ForeignKey to Usercreated_at: DateTimeField (auto_now_add=True)updated_at: DateTimeField (auto_now=True)status: ChoiceField (Draft,Published)
Create views and templates for:
- Listing all blog posts
- Creating a new blog post
- Updating an existing blog post
- Deleting a blog post
- Viewing a single blog post
Create a Comment model with:
post: ForeignKey to Postauthor: ForeignKey to Usercontent: TextFieldcreated_at: DateTimeField (auto_now_add=True)
- Allow users to add comments to a blog post
- Display comments under each blog post
- Implement a like button for each blog post
- Track the number of likes for each post
Login Page Reference:
👉 Login Page Template
Ensure you have the following installed:
- Python 3.x
pip(Python package manager)- Virtual environment tool (optional but recommended)
git clone https://github.com/shubham31121999/BlogSite.git
cd BlogSitepython -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activatepip install -r requirements.txtpython manage.py migratepython manage.py createsuperuserpython manage.py runserver- 🌐 Frontend: http://127.0.0.1:8000/
- 🔧 Admin Panel: http://127.0.0.1:8000/admin/
- Create a Virtual Environment:
python -m venv venv
- Activate the Virtual Environment:
venv\Scripts\activate
- Create a Django Project Directory:
django-admin startproject Blog
- Navigate to the Project Directory:
cd Blog - Create a Web App for the Project:
python manage.py startapp socialsite
- Rename
BlogDirectory toconfig& Add Django for Settings Management. - Restructure Files for Better Development Setup:
- The
configdirectory contains development settings (base,local,production). - Test cases are placed in
tests.py.
- The
- Modify
wsgi.py,asgi.py, andmanage.pyto Reflect New Project Naming. - Design and Implement the Login & Signup Page with a Slider Effect.
- User Signup Fields Include:
First Name,Last Name,Password,Date of Birth,Email.- Each user is assigned a unique ID using
uuid.
- Backend: Django
- Database: SQLite (default), can be configured for PostgreSQL
- Frontend: Django Templates, HTML, CSS, JavaScript
This project is licensed under the MIT License.
Feel free to fork the repository and contribute!
Submit a pull request with improvements or bug fixes.
🚀 Happy Coding! 🚀