mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 07:52:54 +00:00
✅ CLEANED FILES: - Removed 5 duplicate docker-compose files → kept 1 working docker-compose.dokploy.yml - Deleted debugging files: debug_settings.py, test-docker-build.sh, cookies.txt, entrypoint.sh - Removed redundant docs: DOKPLOY.md, DEPLOYMENT.md, QUICKSTART.md, Dockerfile.simple - Fixed all file references to use docker-compose.dokploy.yml consistently 📚 CLEAN DOCUMENTATION STRUCTURE: - README.md: Overview with quick links to deployment guides - QUICK_DEPLOY.md: 3-step deployment guide (zero code changes needed) - DEPLOYMENT_CHECKLIST.md: Complete troubleshooting reference - WARP.md: Developer/agent guidance 🎯 RESULT: - Clean, confusion-free project structure - Single source of truth for deployment - Zero hardcoded values - everything uses environment variables - Clone-and-deploy ready with minimal setup The project is now production-ready and maintainable! 🚀
110 lines
3.0 KiB
Markdown
110 lines
3.0 KiB
Markdown
# 🚀 Quick Deploy Guide - Zero Changes Needed!
|
|
|
|
This Django template is designed to deploy **without any code changes** - just set environment variables!
|
|
|
|
## ✅ **Clone and Deploy in 3 Steps**
|
|
|
|
### **Step 1: Clone Repository**
|
|
```bash
|
|
git clone https://github.com/your-username/django-template.git
|
|
cd django-template
|
|
```
|
|
|
|
### **Step 2: Set Environment Variables in Dokploy**
|
|
Set these **4 required variables** in Dokploy environment tab:
|
|
|
|
```env
|
|
DOMAIN_NAME=yourdomain.com
|
|
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
|
|
CSRF_TRUSTED_ORIGINS=https://yourdomain.com
|
|
SECRET_KEY=your-secret-key-here
|
|
```
|
|
|
|
**Optional variables:**
|
|
```env
|
|
DEBUG=False
|
|
SECURE_SSL_REDIRECT=True
|
|
GOOGLE_OAUTH2_CLIENT_ID=your-google-client-id
|
|
GOOGLE_OAUTH2_CLIENT_SECRET=your-google-client-secret
|
|
```
|
|
|
|
### **Step 3: Deploy**
|
|
1. **Dokploy Compose Path**: `./docker-compose.dokploy.yml`
|
|
2. **Domain**: Set in Dokploy UI (service=web, port=8000)
|
|
3. **Deploy** 🚀
|
|
|
|
## 🎯 **That's It! No Code Changes Required!**
|
|
|
|
### **Default Values** (works out-of-the-box for testing):
|
|
- **DOMAIN_NAME**: `localhost`
|
|
- **ALLOWED_HOSTS**: `localhost,127.0.0.1`
|
|
- **CSRF_TRUSTED_ORIGINS**: `http://localhost:8000`
|
|
- **SECRET_KEY**: Development key (change for production!)
|
|
- **DEBUG**: `True` (change to `False` for production)
|
|
|
|
### **What Happens Automatically:**
|
|
✅ Database migrations run
|
|
✅ User groups created (admin, staff, user)
|
|
✅ Site configured with your domain
|
|
✅ Social apps set up
|
|
✅ Static files collected
|
|
✅ Gunicorn starts serving your app
|
|
|
|
## 🔧 **For Different Deployment Platforms**
|
|
|
|
### **Included Database (Default)**
|
|
- **Compose file**: `docker-compose.dokploy.yml`
|
|
- **Database**: Included PostgreSQL container
|
|
- **Storage**: Docker volumes for persistence
|
|
|
|
### **External Database**
|
|
- **Compose file**: `docker-compose.dokploy.yml` + set `DATABASE_URL`
|
|
- **Examples**: Neon, Supabase, Railway, etc.
|
|
|
|
## 🧪 **Test Locally First** (Optional)
|
|
|
|
```bash
|
|
# 1. Set environment variables
|
|
export DOMAIN_NAME=localhost
|
|
export ALLOWED_HOSTS=localhost,127.0.0.1
|
|
export SECRET_KEY=test-secret-key
|
|
|
|
# 2. Test with Docker
|
|
docker-compose -f docker-compose.dokploy.yml up
|
|
|
|
# 3. Visit http://localhost:8000
|
|
```
|
|
|
|
## 🎉 **Environment Variable Examples**
|
|
|
|
### **For `myapp.com`:**
|
|
```env
|
|
DOMAIN_NAME=myapp.com
|
|
ALLOWED_HOSTS=myapp.com,www.myapp.com
|
|
CSRF_TRUSTED_ORIGINS=https://myapp.com,https://www.myapp.com
|
|
SECRET_KEY=super-long-secret-key-generate-new-one
|
|
DEBUG=False
|
|
SECURE_SSL_REDIRECT=True
|
|
```
|
|
|
|
### **For `app.example.org`:**
|
|
```env
|
|
DOMAIN_NAME=app.example.org
|
|
ALLOWED_HOSTS=app.example.org
|
|
CSRF_TRUSTED_ORIGINS=https://app.example.org
|
|
SECRET_KEY=another-unique-secret-key
|
|
DEBUG=False
|
|
SECURE_SSL_REDIRECT=True
|
|
```
|
|
|
|
## ⚡ **Why This Works**
|
|
|
|
- ✅ **No hardcoded domains** - everything uses environment variables
|
|
- ✅ **Sensible defaults** - works locally without any setup
|
|
- ✅ **Production ready** - just change a few env vars
|
|
- ✅ **Platform agnostic** - works on Dokploy, Railway, Heroku, etc.
|
|
|
|
---
|
|
|
|
**Clone ➜ Set 4 env vars ➜ Deploy ➜ Done!** 🚀
|