Installation¶
Quickstart¶
# Install with your chosen backend
pip install django-prodserver[gunicorn]
Add to your settings.py:
INSTALLED_APPS = [
# ...
"django_prodserver",
]
PRODUCTION_PROCESSES = {
"web": {
"BACKEND": "django_prodserver.backends.servers.gunicorn.GunicornServer",
"ARGS": {"bind": "0.0.0.0:8000", "workers": "2"},
}
}
Run your server:
python manage.py server web
Deprecated since version 3.0.0: The prodserver command has been renamed to server. The old name continues
to work as an alias but will be removed in django-prodserver 4.0.0.
Choosing a Backend¶
Web Servers¶
Background Workers¶
Backend |
Best For |
|---|---|
Distributed tasks, complex workflows, Redis/RabbitMQ |
|
Monitoring/admin web UI for Celery clusters |
|
Simple tasks, no external dependencies |
|
ORM-backed queues, scheduled tasks |
Installing Backends¶
Backends can be installed via pip extras or separately.
Via Pip Extras (Recommended)¶
pip install django-prodserver[gunicorn]
pip install django-prodserver[uvicorn]
pip install django-prodserver[waitress]
pip install django-prodserver[granian]
pip install django-prodserver[celery]
pip install django-prodserver[flower]
pip install django-prodserver[django-tasks]
pip install django-prodserver[django-q2]
# Multiple backends
pip install django-prodserver[gunicorn,celery]
Separately¶
pip install gunicorn
pip install uvicorn
pip install waitress
pip install granian
pip install celery[redis] # or celery[rabbitmq]
pip install django-q2
See individual backend documentation for detailed requirements.
Configuration¶
A more complete example with web and worker processes:
PRODUCTION_PROCESSES = {
"web": {
"BACKEND": "django_prodserver.backends.servers.gunicorn.GunicornServer",
"ARGS": {"bind": "0.0.0.0:8000", "workers": "4"},
},
"worker": {
"BACKEND": "django_prodserver.backends.workers.celery.CeleryWorker",
"APP": "myproject.celery.app",
"ARGS": {"concurrency": "4"},
},
}
See Configuration for all options.
Troubleshooting¶
ImportError: No module named ‘gunicorn’
: Install the backend: pip install django-prodserver[gunicorn]
Django app not found
: Add "django_prodserver" to INSTALLED_APPS
PRODUCTION_PROCESSES not found
: Add the PRODUCTION_PROCESSES dict to your settings
For more help, see Troubleshooting.
Next Steps¶
Usage - Running your configured processes
Backend Reference - Detailed backend documentation
Practical Guides - Deployment tutorials
Configuration - Advanced configuration