A modern, feature-rich blog platform built with Django.
This project demonstrates best practices in Django development, clean UI/UX, and a robust set of features for both writers and readers.
- Create, Edit, Delete Articles: Authenticated users can write, update, and remove their own posts.
- Rich Text Content: Articles support formatted text and images.
- Categories & Tags: Organize articles by categories and tags for easy navigation.
- Article Images: Upload and display cover images for each article.
- Reading Time Estimate: Automatic calculation and display of estimated reading time.
- User Registration & Authentication: Secure sign-up, login, and logout.
- Profile Pages: Each user has a customizable profile with avatar, bio, and stats.
- Profile Picture Upload: Users can upload and update their profile images.
- Password Change: Secure password change functionality.
- Threaded Comments: Readers can comment on articles and reply to other comments.
- Edit/Delete Own Comments: Users can manage their own comments and replies.
- Live Comment Count: Real-time display of the number of comments per article.
- Like/Unlike Articles: Users can like or unlike articles, with like counts displayed.
- Related Posts: Suggests similar articles based on category or tags.
- Full-Text Search: Quickly find articles by title or content.
- Category & Tag Browsing: Filter articles by category or tag.
- Pagination: Clean navigation for browsing large numbers of posts.
- Newsletter Signup: Readers can subscribe to updates.
- Social Sharing: Share articles on popular social platforms.
- Theme Toggle: Switch between light and dark modes for comfortable reading.
- CSRF Protection: All forms are protected against CSRF attacks.
- User Permissions: Only authors can edit or delete their own content.
- Input Validation: All user input is validated and sanitized.
django_blog/
├── account/ # User authentication, profiles
├── blog/ # Article models, views, templates
├── core/ # Core site features (homepage, about, etc.)
├── django_blog/ # Project folder (settings, main urls, etc.)
├── media/ # Uploaded images (articles, profiles)
├── static/ # Static files (CSS, JS, images)
├── manage.py
└── requirements.txt
-
Clone the repository:
git clone https://github.com/PeterOlayemi/django_blog.git cd django_blog -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.envfile in the project root with the following variables:SECRET_KEY = your-django-secret-key email = your-email@example.com appsPassword = your-app-specific-passwordSECRET_KEY: Your Django secret key (generate withpython -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())')email: The email address used for sending emails (e.g., for password reset, newsletter)appsPassword: The app-specific password for your email provider (e.g., Gmail App Password)
-
Apply migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the site:
- Visit http://127.0.0.1:8000/ in your browser.
- Static files: Place CSS, JS, and images in
static/. - Media files: Uploaded images are stored in
media/. - Templates: Use Django templating in
templates/directories.
- Branding: Update colors and logos in
static/css/base.cssandstatic/images/. - Email/Newsletter: Configure email backend in
settings.pyfor newsletter features. - Social Links: Add your social media URLs in the footer template.
This project is licensed under the MIT License.
- Built with Django
- UI inspired by modern blog platforms
- Icons from Font Awesome
For questions or collaboration, reach out via olayemipeter177@gmail.com or open an issue.
Star this repo ⭐ if you like it, and feel free to fork for your own portfolio