A feature-rich blog application built with Django, featuring posts, comments, tags, and a read-later functionality.
- π Blog posts with rich content
- π₯ Author management
- π·οΈ Tag system for categorizing posts
- π¬ Comment system for user engagement
- π Read-later functionality using sessions
- π± Responsive design
- π Admin panel for content management
- πΌοΈ Image upload support for posts
- Framework: Django 5.2.7
- Database: SQLite (development) / PostgreSQL (production)
- Python: 3.12.0
- WSGI Server: Gunicorn
- Static Files: WhiteNoise
- Image Processing: Pillow
βββ blog/ # Blog application
β βββ models.py # Post, Author, Tag, Comment models
β βββ views.py # Class-based views
β βββ forms.py # Comment form
β βββ urls.py # URL routing
β βββ templates/ # HTML templates
β βββ static/ # CSS and images
βββ my_site/ # Project settings
β βββ settings.py # Configuration
β βββ urls.py # Root URL config
β βββ wsgi.py # WSGI configuration
βββ templates/ # Base templates
βββ static/ # Global static files
βββ uploads/ # Media uploads
βββ requirements.txt # Python dependencies
βββ build.sh # Render build script
βββ render.yaml # Render configuration
βββ manage.py # Django management script
- Python 3.12+
- pip
- virtualenv (recommended)
-
Clone the repository
git clone <your-repo-url> cd Section-11
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env with your settings -
Run migrations
python manage.py migrate
-
Create superuser
python manage.py createsuperuser
-
Collect static files
python manage.py collectstatic
-
Run development server
python manage.py runserver
-
Access the application
- Homepage: http://localhost:8000
- Admin: http://localhost:8000/admin
This project is configured for deployment on Render.
- Push to GitHub
- Create Render account
- Use Blueprint deployment with
render.yaml
For detailed instructions, see:
- Full Guide: DEPLOYMENT.md
- Quick Reference: DEPLOYMENT_CHECKLIST.md
- Title, slug, excerpt, content
- Publication date (auto-generated)
- Image upload
- Author (Foreign Key)
- Tags (Many-to-Many)
- First name, last name
- Email address
- Full name method
- Caption (unique identifier)
- User name and email
- Comment text
- Related post (Foreign Key)
/- Homepage (latest 3 posts)/posts- All posts/posts/<slug>- Individual post detail/read-later- Saved posts/admin- Admin panel
SECRET_KEY=<your-secret-key>
DEBUG=True|False
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=<postgresql-url> # Production only
- Development: Served by Django
- Production: Served by WhiteNoise
- Development: Local filesystem
- Production: Recommend Cloudinary or S3
Production deployment includes:
- β HTTPS redirect
- β Secure cookies
- β CSRF protection
- β XSS filtering
- β HSTS headers
- β Content type sniffing prevention
python manage.py testpython manage.py makemigrations
python manage.py migrateUse Django admin panel or Django shell:
python manage.py shell- Login to admin panel
- Create Author (if needed)
- Create Tags (if needed)
- Create Post with title, content, slug, etc.
- Comments appear on individual post pages
- Moderate via admin panel
python manage.py collectstatic --clear
python manage.py collectstaticpython manage.py migrate --run-syncdbchmod +x build.sh- Fork the repository
- Create feature branch
- Commit changes
- Push to branch
- Open pull request
For general Django help, visit Django Documentation
Built with Django