A management command to start production servers/workers with a consistent interface
Project description
Django prodserver
Documentation: https://django-prodserver.readthedocs.io
Source Code: https://github.com/nanorepublica/django-prodserver
A management command to start production servers/workers with a consistent interface
Installation
Install this via pip (or your favourite package manager):
pip install django-prodserver
Add the app to your INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"django_prodserver",
]
Configuration
Add the PRODUCTION_PROCESSES setting to your settings.py. Below shows an example with a web process and worker process defined.
The comments show other available backend processes that are available to use.
PRODUCTION_PROCESSES = {
"web": {
"BACKEND": "django_prodserver.backends.gunicorn.GunicornServer",
"ARGS": {"bind": "0.0.0.0:8111"},
},
# "web": {
# "BACKEND": "django_prodserver.backends.waitress.WaitressServer",
# "ARGS": {},
# },
# "web": {
# "BACKEND": "django_prodserver.backends.uvicorn.UvicornServer",
# "ARGS": {},
# },
# "web": {
# "BACKEND": "django_prodserver.backends.uvicorn.UvicornWSGIServer",
# "ARGS": {},
# },
"worker": {
"BACKEND": "django_prodserver.backends.celery.CeleryWorker",
"APP": "tests.celery.app",
"ARGS": {},
},
# "worker": {
# "BACKEND": "django_prodserver.backends.django_tasks.DjangoTasksWorker",
# "ARGS": {},
# },
}
Usage
Once the PRODUCTION_PROCESSES setting has been configured you can then start the processes as follows:
python manage.py prodserver web
python manage.py prodserver worker
Creating a new backend.
Creating a backend is fairly simple. Subclass the BaseServerBackend class, then implement
the start_server method which should call the underlying process in the best possible way for a production
setting. You can also optionally override prep_server_args method to aid with this to provide any default arguments
or formatting to the start_server command.
See django_prodserver.backends for examples of existing backends for inspiration. Pull Request's are welcome for
additional backends.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_prodserver-2.0.0.tar.gz.
File metadata
- Download URL: django_prodserver-2.0.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a0f2462595b70c9173a0822c01d7369dcaaa0065df100418062d364db76c70f
|
|
| MD5 |
6a632aad607f80c964d28b339c65eeaf
|
|
| BLAKE2b-256 |
96fe3ca1ac0e6839f990a99981d86e341d6fa94cb796ce843cfc48397e495d1b
|
Provenance
The following attestation bundles were made for django_prodserver-2.0.0.tar.gz:
Publisher:
ci.yml on nanorepublica/django-prodserver
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_prodserver-2.0.0.tar.gz -
Subject digest:
9a0f2462595b70c9173a0822c01d7369dcaaa0065df100418062d364db76c70f - Sigstore transparency entry: 449181152
- Sigstore integration time:
-
Permalink:
nanorepublica/django-prodserver@c0712dd8bbe02fb19ae94e079c6b3b85e94f5ed9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nanorepublica
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c0712dd8bbe02fb19ae94e079c6b3b85e94f5ed9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_prodserver-2.0.0-py3-none-any.whl.
File metadata
- Download URL: django_prodserver-2.0.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41e6095b3df862f5d64998250ef86efc30116e8e7cb4ef4bdf20e71cc73bd7b1
|
|
| MD5 |
5dfaf457ea18b90afe72f4bb929b0bbe
|
|
| BLAKE2b-256 |
667e0253b4cd1a2f1e71f939a5de0cc6e542266ba155ea5a899fb797c352cfa9
|
Provenance
The following attestation bundles were made for django_prodserver-2.0.0-py3-none-any.whl:
Publisher:
ci.yml on nanorepublica/django-prodserver
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_prodserver-2.0.0-py3-none-any.whl -
Subject digest:
41e6095b3df862f5d64998250ef86efc30116e8e7cb4ef4bdf20e71cc73bd7b1 - Sigstore transparency entry: 449181162
- Sigstore integration time:
-
Permalink:
nanorepublica/django-prodserver@c0712dd8bbe02fb19ae94e079c6b3b85e94f5ed9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nanorepublica
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c0712dd8bbe02fb19ae94e079c6b3b85e94f5ed9 -
Trigger Event:
push
-
Statement type: