βββββββ βββ ββββββ ββββ βββ βββββββ βββββββ
ββββββββ ββββββββββββββββ βββββββββββ βββββββββ
βββ βββ βββββββββββββββββ ββββββ βββββββ βββ
βββ βββββ ββββββββββββββββββββββββ ββββββ βββ
βββββββββββββββββββ ββββββ ββββββββββββββββββββββββ
βββββββ ββββββ βββ ββββββ βββββ βββββββ βββββββ
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.