██████╗ ██╗ █████╗ ███╗ ██╗ ██████╗ ██████╗
██╔══██╗ ██║██╔══██╗████╗ ██║██╔════╝ ██╔═══██╗
██║ ██║ ██║███████║██╔██╗ ██║██║ ███╗██║ ██║
██║ ██║██ ██║██╔══██║██║╚██╗██║██║ ██║██║ ██║
██████╔╝╚█████╔╝██║ ██║██║ ╚████║╚██████╔╝╚██████╔╝
╚═════╝ ╚════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝
Login & Blog App | Docker | CI/CD
A powerful Django-based web application featuring modular apps for user authentication, blog post management, and extended utilities — fully containerised with Docker and automated with GitHub Actions CI/CD.
✨ Features · 📁 Structure · 🚀 Quick Start · 🐳 Docker · 🔁 CI/CD · 📦 Dependencies
| # | Feature | Description |
|---|---|---|
| 🔐 | User Authentication | Secure login and registration system |
| 📝 | Blog Management | Create, list, and manage blog posts |
| 📁 | Media Uploads | Handle images and Excel file uploads |
| 📊 | Excel Processing | Read and store data from .xlsx files |
| 📜 | Admin Access Logs | Track admin activity via log files |
| 🐳 | Dockerized Setup | One-command container build & run |
| 🔄 | CI/CD Pipeline | Auto-build, push, and deploy on commit |
django-login-blog/
│
├── 📄 Dockerfile # Docker image configuration
├── 📄 manage.py # Django entry point
├── 📄 requirements.txt # Python dependencies
├── 📄 cb.sqlite3 # SQLite database
├── 📄 user_data.xlsx # Sample Excel data file
│
├── 📂 templates/ # HTML UI templates
│ ├── base.html # Base layout template
│ ├── index.html # Home page
│ ├── form.html # Form page
│ ├── blog.html # Blog listing page
│ ├── Thankyou.html # Success / thank-you page
│ └── myapp/
│ └── pdf_list.html # PDF listing template
│
├── 📂 media/ # User-uploaded files
│ ├── blog_image/ # Blog post images
│ └── user_data.xlsx # Uploaded Excel data
│
├── 📂 log/
│ └── admin_access.log # Admin activity log
│
├── 📂 login/ # 🔐 Authentication app
│ ├── settings.py # Project settings
│ ├── views.py # Login/register views
│ ├── urls.py # URL routing
│ ├── wsgi.py # WSGI entry point
│ └── asgi.py # ASGI entry point
│
├── 📂 myapp/ # 📝 Blog logic app
│ ├── models.py # Blog data models
│ ├── forms.py # Blog forms
│ ├── views.py # Blog views
│ ├── urls.py # Blog URL routing
│ └── migrations/ # Database migrations
│
├── 📂 myapp1/ # 🔧 Extended feature module
│ ├── models.py # Extended models
│ ├── views.py # Extended views
│ └── urls.py # Extended URL routing
│
└── 📂 .github/
└── workflows/
└── deploy.yml # 🔄 GitHub Actions CI/CD workflowgit clone https://github.com/Unixxxxxx/django-login-blog.git
cd django-login-blogpip install -r requirements.txtpython manage.py migratepython manage.py runserver✅ Visit
http://localhost:8000in your browser.
docker build -t mynewapp .docker run -d -p 8000:8000 mynewapp✅ Visit
http://localhost:8000— your app is live inside Docker.
# View running containers
docker ps
# Stop the container
docker stop <container_id>
# View logs
docker logs <container_id>Deployment is fully automated via GitHub Actions on every push to main.
📦 Push to main
│
├── ✅ Build Docker image
├── ✅ Login to Docker Hub
└── ✅ Push image to Docker Hub
Workflow file location:
.github/workflows/deploy.ymlWorkflow overview:
name: CI/CD Pipeline
on:
push:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/mynewapp .
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Push to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/mynewappInstall all dependencies with a single command:
pip install -r requirements.txtCore packages:
| Package | Purpose |
|---|---|
django |
Web framework |
pillow |
Image upload handling |
openpyxl |
Excel file processing |
gunicorn |
Production WSGI server |
📁 Media Files → media/blog_image/ (blog post images)
📊 Excel Files → media/user_data.xlsx (uploaded data)
📜 Admin Logs → log/admin_access.log (access tracking)
🗃️ Database → cb.sqlite3 (SQLite — dev only)
⚠️ Production Note: Replacecb.sqlite3with PostgreSQL or MySQL for production deployments.
MIT License — free to use, modify, and distribute.
See the LICENSE file for full terms.