hostinger-django-demo/deploy/templates/gunicorn.service.template
thecyberlearn f721b0a87e Add comprehensive production deployment system
- Complete deployment documentation (PRODUCTION_DEPLOYMENT.md)
- Automated deployment script (production-deploy.sh)
- Systemd service templates (socket + service)
- Production settings template with security best practices
- Nginx configuration template with performance optimizations
- Comprehensive troubleshooting guide
- Quick start guide for fast deployment

Fixes all issues encountered in initial deployment:
- Uses non-root django user for security
- Proper /var/www directory structure
- Unix socket instead of TCP for better performance
- Socket activation with systemd
- Correct virtual environment handling
- Production security headers and settings

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-29 23:03:30 +05:30

23 lines
613 B
Plaintext

# Gunicorn Service Template
# Copy to: /etc/systemd/system/gunicorn.service
# Replace: {{PROJECT_NAME}}, {{APP_NAME}}
[Unit]
Description=Gunicorn daemon for {{APP_NAME}}
Requires=gunicorn.socket
After=network.target
[Service]
User=django
Group=www-data
WorkingDirectory=/var/www/{{APP_NAME}}
Environment=DJANGO_SETTINGS_MODULE={{PROJECT_NAME}}.settings
EnvironmentFile=/var/www/{{APP_NAME}}/.env
ExecStart=/var/www/{{APP_NAME}}/venv/bin/gunicorn \
--workers 3 \
--bind unix:/run/gunicorn.sock \
{{PROJECT_NAME}}.wsgi:application
Restart=always
[Install]
WantedBy=multi-user.target