Commit Graph

3 Commits

Author SHA1 Message Date
bf69fe88d9 feat: Add staging environment for local production testing
- Add docker-compose.staging.yml with PostgreSQL and Django
- Add .env.staging.example with staging-specific environment variables
- Configure staging settings (DEBUG=False, no SSL redirect for localhost)
- Update settings/__init__.py to support staging environment detection
- Update AGENTS.md with staging environment documentation
- Update .gitignore to exclude .env.staging
- Optimize docker-compose.prod.yml configuration

Staging environment simulates production configuration locally:
- PostgreSQL database (port 5433 to avoid conflicts)
- Gunicorn with 4 workers
- DEBUG=False but HTTP allowed for easier testing
- Separate volumes for static files, media, and logs

Usage:
  cp .env.staging.example .env.staging
  docker compose -f docker-compose.staging.yml up -d
2026-05-10 20:32:42 -05:00
8818246870 feat: Add WhiteNoise for static files serving
- Add whitenoise==6.6.0 to requirements.txt
- Configure WhiteNoise middleware in base settings
- Add WhiteNoise STORAGES configuration for all environments
- Reorder CORS middleware to correct position (before CommonMiddleware)
- Enable automatic Gzip compression and cache busting
- Configure environment-specific settings:
  * Development: autorefresh enabled, use finders
  * Staging: 10min cache, autorefresh for testing
  * Production: 1 year cache, strict mode, optimized

Fixes issue with Django REST Framework static files returning 404
in staging/production environments (DEBUG=False).

WhiteNoise now serves all static files (CSS, JS, images) with:
- Automatic Gzip compression (~84% size reduction)
- Cache busting with content hashing
- Optimized cache headers
- No nginx required for static files
2026-05-10 20:32:30 -05:00
294dbdee91 feat: Add deploy environment, Add pyprojectoml 2026-05-09 19:09:31 -05:00