A full-featured blog application built with Django and Django REST Framework, featuring user authentication, post management, commenting system, and user profiles. This project demonstrates modern web development practices with a clean, responsive Bootstrap 5 interface.
- User Registration: New users can create accounts with secure signup functionality
- Session-Based Authentication: Secure login/logout system using Django's built-in session management
- Access Control: Login required decorators protect sensitive routes and functionality
- User Authorization: Users can only edit and delete their own posts, ensuring content ownership
- Create Posts: Authenticated users can create new blog posts with rich content
- Edit Posts: Users can modify their own posts with an intuitive editing interface
- Delete Posts: Post authors have the ability to remove their own content
- Slug-Based URLs: Clean, SEO-friendly URLs using slugs for individual post viewing
- Dynamic Rendering: Components are rendered dynamically based on user permissions and content
- Profile Management: Each user has a dedicated profile page
- User Information Display: Comprehensive user details and statistics
- Profile Customization: Users can manage their account information
- Nested Comments: Hierarchical comment structure for organized discussions
- Comment Management: Users can engage with posts through a robust commenting system
- Serialized Data: Comments are efficiently handled through nested serializers
- Bootstrap 5: Modern, responsive design using the latest Bootstrap framework
- Template Inheritance: DRY principle implementation with reusable base templates
- Mobile Responsive: Optimized for all device sizes and screen resolutions
- Intuitive Interface: Clean, user-friendly design with smooth navigation
- Python: Core programming language for server-side logic
- Django: High-level Python web framework for rapid development
- Django REST Framework: Powerful toolkit for building Web APIs
- HTML5: Semantic markup for structured content
- Bootstrap 5: CSS framework for responsive, mobile-first design
- Template System: Django's built-in templating engine with inheritance
- PostgreSQL: Production-ready relational database with advanced features and scalability
The application is organized into four main Django apps:
Dedicated to all authentication purposes including user login, registration, logout, password management, and session handling. This app ensures secure user access control throughout the application.
Specifically focused on creating and managing user profiles. Handles user profile information, profile updates, user statistics, and profile-related functionality separate from authentication logic.
Handles all blog post related functionality including creation, editing, deletion, and display of blog posts with slug-based routing.
Manages the commenting system with nested serialization support, allowing for threaded discussions on blog posts.
- Python 3.8 or higher
- pip (Python package manager)
git clone https://github.com/yourusername/django-blog.git
cd django-blog
python -m venv venv
venv\Scripts\activate # On Windows (default)
source venv/bin/activate # On macOS/Linux
pip install django
pip install djangorestframework
pip install pillow
pip install psycopg2-binary
Configure your PostgreSQL database in settings.py
:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'myproject_db', # The database name you created in pgAdmin
'USER': 'postgres', # Default PostgreSQL username
'PASSWORD': 'your_password_here', # Password you set during installation
'HOST': 'localhost', # Database server location
'PORT': '5432', # Default PostgreSQL port
}
}
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Visit http://127.0.0.1:8000/posts
to access the application.
Implementation of slug-based URLs for individual post viewing, creating SEO-friendly and human-readable web addresses that improve user experience and search engine optimization.
Advanced templating techniques that render components based on user authentication status, permissions, and content ownership, providing a personalized experience for each user.
Comprehensive security implementation using Django's built-in authentication system, including session management, login required decorators, and permission-based access control.
Modern frontend development using Bootstrap 5's utility classes, responsive grid system, and component library to create a professional, mobile-first user interface.
Advanced Django REST Framework implementation featuring nested serializers that efficiently handle complex data relationships, particularly for displaying comments associated with blog posts.
Implementation of DRY (Don't Repeat Yourself) principles through Django's template inheritance system, creating maintainable and reusable template structures.
- CSRF Protection: Built-in cross-site request forgery protection
- Session Security: Secure session-based authentication
- Permission Validation: Server-side permission checking for all sensitive operations
- Input Sanitization: Protection against common web vulnerabilities
- User Authorization: Strict content ownership validation
This project demonstrates proficiency in:
- Full-Stack Development: Integration of backend logic with frontend presentation
- Django Framework: Advanced usage of Django's features and conventions
- REST API Development: Building efficient APIs with Django REST Framework
- Database Relationships: Managing complex data relationships and migrations
- User Experience Design: Creating intuitive interfaces with Bootstrap 5
- Security Best Practices: Implementing authentication and authorization systems
- Code Organization: Structuring large applications with multiple apps and clear separation of concerns
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is open source and available for use.
If you have any questions or suggestions, please feel free to reach out or open an issue in the repository.
Built with ❤️ using Django and Django REST Framework