Barodybroject Quick Reference Card¶
Version: 2.0.0 | Date: 2025-01-27
🚀 Quick Start (30 seconds)¶
Select your setup mode and follow the prompts!
📋 Setup Modes¶
1️⃣ Docker Development (Recommended)¶
Use when: Starting development, closest to production
Access: http://localhost:8000 Features: Hot-reload, isolated environment2️⃣ Local Development¶
Use when: No Docker, or prefer virtual environment
Requires: Python 3.8+, PostgreSQL3️⃣ Azure Deployment¶
Use when: Deploying to cloud production
Requires: Azure CLI, azd, active Azure subscription4️⃣ Testing/CI¶
Use when: Running CI/CD tests
Runs: 56 automated infrastructure checks🔧 Common Commands¶
Docker Operations¶
# Start containers
docker-compose up -d
# View logs
docker-compose logs -f python
# Stop containers
docker-compose stop
# Rebuild containers
docker-compose up --build --force-recreate -d
# Shell access
docker-compose exec python bash
Django Management¶
# Migrations
docker-compose exec python python manage.py migrate
# Create superuser
docker-compose exec python python manage.py createsuperuser
# Collect static files
docker-compose exec python python manage.py collectstatic
# Django shell
docker-compose exec python python manage.py shell
Testing¶
# Full infrastructure test
./scripts/test-infrastructure.sh
# Django tests
docker-compose exec python python manage.py test
# With coverage
docker-compose exec python pytest --cov=parodynews
Azure Management¶
# Login to Azure
az login
azd auth login
# Deploy application
azd up
# Post-deployment config
./scripts/azure-deployment-setup.py
# View logs
az containerapp logs show --name <app> --resource-group <rg>
🐛 Quick Troubleshooting¶
Problem: Script won't run¶
Problem: Port already in use¶
Problem: Database connection failed¶
# Restart database
docker-compose restart barodydb
# Fresh start (⚠️ deletes data)
docker-compose down -v
docker-compose up -d
Problem: Missing dependencies¶
# macOS
brew install python3 git docker
# Linux
sudo apt-get install python3 python3-pip git docker.io
Problem: Environment configuration¶
# Copy template
cp .env.example .env
# Generate secret key
python3 -c "import secrets; print(secrets.token_urlsafe(50))"
📚 Documentation¶
| Resource | Path | Purpose |
|---|---|---|
| Main README | ../README.md | Project overview |
| Setup Guide | ../scripts/README.md | Script documentation |
| Testing Guide | INFRASTRUCTURE_TESTING.md | Infrastructure testing |
| Security Docs | SECURITY_DOCUMENTATION.md | Security best practices |
🎯 Key Environment Variables¶
| Variable | Required | Purpose |
|---|---|---|
SECRET_KEY |
Yes | Django secret key |
DEBUG |
No | Debug mode (default: False) |
DB_PASSWORD |
Yes | Database password |
ALLOWED_HOSTS |
Yes | Comma-separated allowed hosts |
OPENAI_API_KEY |
No | OpenAI integration (optional) |
DJANGO_DEV_PORT |
No | Development server port (default: 8000) |
POSTGRES_PORT |
No | PostgreSQL port (default: 5432) |
✅ Validation Checklist¶
Before deploying to production:
- All tests pass (
./scripts/test-infrastructure.sh) - Environment variables configured (
.env) - Database migrations applied
- Static files collected
- Superuser created
- Security settings enabled (HTTPS, headers)
- Backup strategy in place
- Monitoring configured
- Health checks working
- Documentation updated
🆘 Get Help¶
Issues: https://github.com/bamr87/barodybroject/issues Email: bamr87@users.noreply.github.com
Emergency Commands:
# View all logs
docker-compose logs -f
# Check application health
curl -I http://localhost:8000/
# Test database connection
docker-compose exec python python manage.py check --database default
📊 System Status¶
Check system health:
# Docker status
docker-compose ps
# Application status
curl http://localhost:8000/health/
# Database status
docker-compose exec barodydb pg_isready
# Azure status (if deployed)
az containerapp show --name <app> --resource-group <rg> --query properties.runningStatus
Quick Reference Version: 1.0 Compatible with: Barodybroject v2.0.0+ Last Updated: 2025-01-27
Print this page or save for offline reference!