A feature-rich, production-ready blogging platform built with Django MVT architecture
Features • Architecture • Installation • Usage • API
- Overview
- Key Features
- Technical Stack
- Architecture
- Installation
- Configuration
- Usage
- Project Structure
- Database Schema
- Contributing
- License
Postify is a comprehensive blogging platform that demonstrates professional Django development practices. The project showcases a complete MVT (Model-View-Template) implementation with advanced features including user authentication, rich markdown support, hierarchical commenting, and real-time analytics.
- Provide a scalable and maintainable blogging solution
- Demonstrate best practices in Django development
- Implement a clean, modern UI/UX
- Support markdown-based content creation
- Enable community engagement through comments and interactions
Backend Architecture: All backend features, models, views, business logic, and database architecture were developed from scratch by Abdulrahman Eldeeb, showcasing expertise in Django framework and Python development.
Frontend Design: The user interface and styling were generated with AI assistance to accelerate development, allowing focus on robust backend implementation.
- Custom user registration and login system
- Profile management with avatar support (binary storage)
- User bio and metadata
- Session-based authentication with allauth integration
- Social authentication (Google OAuth integration)
- Rich markdown editor for post creation
- Cover image support with binary storage
- Category and tag organization
- Auto-generated URL slugs
- Post archiving functionality
- View count tracking
- Automatic read time calculation
- Hierarchical comment system (parent-child relationships)
- Nested replies support
- Real-time comment threads
- User attribution and timestamps
- Personal dashboard for content creators
- Post statistics (views, comments, engagement)
- Monthly publication trends with Chart.js visualization
- Quick access to recent posts
- Archive management
- Responsive design (mobile, tablet, desktop)
- Clean, professional interface
- Blue and orange color palette
- Smooth animations and transitions
- Custom 404 and 500 error pages
- Browse posts by category
- Filter by tags
- Search functionality
- Featured posts section
- Related posts recommendations
- Framework: Django 5.2.7
- Language: Python 3.x
- ORM: Django ORM (SQLite for development)
- Authentication: Django Allauth
- Markdown Processing: Python Markdown
- Template Engine: Django Templates (Jinja2-like)
- Styling: CSS3 with CSS Variables
- JavaScript: Vanilla JS (ES6+)
- Charts: Chart.js for analytics
- Icons: Emoji-based iconography
- Development: SQLite3
- Production Ready: PostgreSQL/MySQL compatible
- Configuration: python-dotenv for environment variables
- Static Files: Django Static Files management
- Media: Binary field storage for images
┌─────────────────────────────────────────────────┐
│ Client Request │
└─────────────────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ URLs (Routing Layer) │
│ - postify_project/urls.py │
│ - accounts/urls.py │
│ - blog/urls.py │
│ - comments/urls.py │
│ - dashboard/urls.py │
└─────────────────┬───────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Views (Business Logic) │
│ - Function-based views │
│ - Form validation │
│ - Authentication checks │
│ - Database queries │
└─────────────────┬───────────────────────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Models │ │ Templates │
│ (Database) │ │ (Render) │
├───────────────┤ ├───────────────┤
│ • Post │ │ • base.html │
│ • Category │ │ • blog/ │
│ • Tag │ │ • accounts/ │
│ • Comment │ │ • dashboard/ │
│ • Profile │ │ • components/ │
└───────────────┘ └───────────────┘
│ │
└─────────┬─────────┘
▼
┌─────────────────────────────────────────────────┐
│ HTTP Response │
└─────────────────────────────────────────────────┘
Postify is organized into five core Django apps:
core- Landing pages, static content (home, about, contact)accounts- User authentication, profiles, registrationblog- Post management, categories, tags, CRUD operationscomments- Comment system with nested repliesdashboard- User analytics, post management, statistics
- Python 3.8 or higher
- pip (Python package manager)
- Virtual environment (recommended)
-
Clone the repository
git clone https://github.com/ElDEEB21/postify-django.git cd postify-django -
Create and activate virtual environment
# Windows python -m venv venv venv\Scripts\activate # macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
Create a
.envfile in the project root:SECRET_KEY=your-secret-key-here DEBUG=True ALLOWED_HOSTS=localhost,127.0.0.1
-
Run database migrations
python manage.py migrate
-
Create superuser (admin)
python manage.py createsuperuser
-
Collect static files
python manage.py collectstatic --noinput
-
Run development server
python manage.py runserver
-
Access the application
- Website: http://127.0.0.1:8000/
- Admin Panel: http://127.0.0.1:8000/admin/
| Variable | Description | Default |
|---|---|---|
SECRET_KEY |
Django secret key for cryptographic signing | Required |
DEBUG |
Debug mode (True/False) | True |
ALLOWED_HOSTS |
Comma-separated list of allowed hosts | localhost,127.0.0.1 |
The project uses SQLite by default. To use PostgreSQL or MySQL:
# settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postify_db',
'USER': 'your_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}- Log in to your account
- Navigate to Dashboard or click Write in the navbar
- Fill in the post details:
- Title: Your post title
- Excerpt: Brief summary (max 200 chars)
- Content: Full post content (Markdown supported)
- Cover Image: Optional banner image
- Category: Select a category
- Tags: Choose relevant tags
- Click Publish
Postify supports full Markdown syntax:
# Heading 1
## Heading 2
**Bold text**
*Italic text*
[Link](https://example.com)

- List item 1
- List item 2
> Blockquote
`inline code`
```python
# Code block
def hello():
print("Hello, Postify!")```
- Users can comment on any published post
- Reply to comments to create nested threads
- Comments are displayed chronologically
- Only comment authors and admins can delete comments
postify-django/
├── accounts/ # User authentication & profiles
│ ├── models.py # Profile model
│ ├── views.py # Login, register, profile views
│ ├── forms.py # User forms
│ ├── urls.py # Account routes
│ ├── templates/ # Account templates
│ └── static/ # Account-specific CSS/JS
│
├── blog/ # Core blogging functionality
│ ├── models.py # Post, Category, Tag models
│ ├── views.py # CRUD operations for posts
│ ├── forms.py # Post creation forms
│ ├── urls.py # Blog routes
│ ├── templates/ # Blog templates
│ └── static/ # Blog-specific CSS/JS
│
├── comments/ # Comment system
│ ├── models.py # Comment model with parent-child
│ ├── views.py # Comment CRUD
│ ├── forms.py # Comment forms
│ ├── urls.py # Comment routes
│ └── templates/ # Comment templates
│
├── core/ # Landing & static pages
│ ├── views.py # Home, about, contact
│ ├── urls.py # Core routes
│ ├── templates/ # Landing page templates
│ └── static/ # Core CSS/images
│
├── dashboard/ # User dashboard & analytics
│ ├── views.py # Dashboard logic, statistics
│ ├── urls.py # Dashboard routes
│ ├── templates/ # Dashboard templates
│ └── static/ # Dashboard CSS/JS (Chart.js)
│
├── postify_project/ # Project configuration
│ ├── settings.py # Django settings
│ ├── urls.py # Root URL configuration
│ ├── views.py # Custom error handlers
│ ├── wsgi.py # WSGI config
│ └── asgi.py # ASGI config
│
├── static/ # Global static files
│ ├── app.css # Global styles
│ └── components/ # Reusable components
│
├── templates/ # Global templates
│ ├── base.html # Base template
│ ├── 404.html # Custom 404 page
│ ├── 500.html # Custom 500 page
│ └── components/ # Shared components
│
├── manage.py # Django management script
├── requirements.txt # Python dependencies
├── README.md # This file
└── .env # Environment variables (create this)
- id (PK)
- author (FK → User)
- title (CharField)
- excerpt (TextField)
- content (TextField)
- slug (SlugField, unique)
- category (FK → Category)
- tags (M2M → Tag)
- cover_image (BinaryField)
- cover_image_type (CharField)
- views (PositiveIntegerField)
- is_archived (BooleanField)
- created_at (DateTimeField)- id (PK)
- name (CharField)- id (PK)
- name (CharField)- id (PK)
- user (FK → User)
- post (FK → Post)
- parent (FK → Comment, nullable)
- content (TextField)
- created_at (DateTimeField)- id (PK)
- user (OneToOne → User)
- bio (TextField)
- avatar (BinaryField)
- avatar_type (CharField)┌─────────────┐
│ User │
└──────┬──────┘
│ 1
│
│ 1 ┌─────────────┐
├───────┤ Profile │
│ └─────────────┘
│
│ 1..* ┌─────────────┐
├──────┤ Post │
│ └──────┬──────┘
│ │ M
│ 1..* │
├────────┐ │ M ┌─────────────┐
│ │ ├───────┤ Tag │
│ │ │ └─────────────┘
│ │ │
│ │ │ M ┌─────────────┐
│ │ └───────┤ Category │
│ │ └─────────────┘
│ │
│ │ 1..*
│ └────────────┐
│ │
│ 1..* ▼
└──────────────► ┌─────────────┐
│ Comment │
└──────┬──────┘
│
│ self-referencing
└──────┐
│
(parent-child)
GET/POST /accounts/login/- User loginGET/POST /accounts/register/- User registrationPOST /accounts/logout/- User logoutGET/POST /accounts/profile/<username>/- View/edit profile
GET /- Homepage with featured postsGET /blog/- All blog postsGET /blog/<slug>/- View single postGET/POST /blog/write/- Create new post (auth required)GET/POST /blog/<slug>/edit/- Edit post (auth + owner required)POST /blog/<slug>/delete/- Delete post (auth + owner required)
POST /comments/<int:post_id>/add/- Add comment (auth required)POST /comments/<int:comment_id>/delete/- Delete comment (auth required)
GET /dashboard/- User dashboard with statistics (auth required)
GET /about/- About pageGET /contact/- Contact page
The project uses CSS variables for easy theming:
:root {
--primary: #1E40AF; /* Deep Blue */
--secondary: #3B82F6; /* Sky Blue */
--accent: #F59E0B; /* Orange */
--bg: #F9FAFB; /* Off-White */
--text: #1F2937; /* Dark Gray */
--text-light: #4B5563; /* Gray */
--bg-card: #FFFFFF; /* White */
--border: #E5E7EB; /* Light Gray */
--success: #10B981; /* Green */
--error: #EF4444; /* Red */
}Run tests with:
python manage.py testFor coverage:
pip install coverage
coverage run --source='.' manage.py test
coverage report- RESTful API with Django REST Framework
- Post scheduling
- Email notifications
- Advanced search with Elasticsearch
- Post drafts and revisions
- Comment moderation
- RSS feed
- Sitemap generation
- SEO optimization
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Abdulrahman Eldeeb
- GitHub: @ElDEEB21
- Email: ar2724@fayoum.edu.eg
- Django Documentation
- Chart.js for analytics visualization
- Python Markdown library
- The Django community
⭐ If you find this project useful, please consider giving it a star!
Made with ❤️ and Django