django-prodserver


Namedjango-prodserver JSON
Version 2.1.1 PyPI version JSON
download
home_pageNone
SummaryA management command to start production servers/workers with a consistent interface
upload_time2025-08-31 01:54:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Django prodserver

<p align="center">
  <a href="https://github.com/nanorepublica/django-prodserver/actions/workflows/ci.yml?query=branch%3Amain">
    <img src="https://img.shields.io/github/actions/workflow/status/nanorepublica/django-prodserver/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
  </a>
  <a href="https://django-prodserver.readthedocs.io">
    <img src="https://img.shields.io/readthedocs/django-prodserver.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
  </a>
  <a href="https://codecov.io/gh/nanorepublica/django-prodserver">
    <img src="https://img.shields.io/codecov/c/github/nanorepublica/django-prodserver.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
  </a>
</p>
<p align="center">
  <a href="https://github.com/astral-sh/uv">
    <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
  </a>
  <a href="https://github.com/astral-sh/ruff">
    <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
  </a>
  <a href="https://github.com/pre-commit/pre-commit">
    <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
  </a>
</p>
<p align="center">
  <a href="https://pypi.org/project/django-prodserver/">
    <img src="https://img.shields.io/pypi/v/django-prodserver.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
  </a>
  <img src="https://img.shields.io/pypi/pyversions/django-prodserver.svg?style=flat-square&logo=python&amp;logoColor=fff" alt="Supported Python versions">
  <img src="https://img.shields.io/pypi/l/django-prodserver.svg?style=flat-square" alt="License">
</p>

---

**Documentation**: <a href="https://django-prodserver.readthedocs.io" target="_blank">https://django-prodserver.readthedocs.io </a>

**Source Code**: <a href="https://github.com/nanorepublica/django-prodserver" target="_blank">https://github.com/nanorepublica/django-prodserver </a>

---

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`:

```python
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.

```py
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:

```sh
python manage.py prodserver web
```

```sh
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](https://allcontributors.org/docs/en/emoji-key)):

<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- markdownlint-disable -->
<!-- markdownlint-enable -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-end -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Credits

[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)

This package was created with
[Copier](https://copier.readthedocs.io/) and the
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
project template.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-prodserver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Andy Miller <info@akmiller.co.uk>",
    "download_url": null,
    "platform": null,
    "description": "# Django prodserver\n\n<p align=\"center\">\n  <a href=\"https://github.com/nanorepublica/django-prodserver/actions/workflows/ci.yml?query=branch%3Amain\">\n    <img src=\"https://img.shields.io/github/actions/workflow/status/nanorepublica/django-prodserver/ci.yml?branch=main&label=CI&logo=github&style=flat-square\" alt=\"CI Status\" >\n  </a>\n  <a href=\"https://django-prodserver.readthedocs.io\">\n    <img src=\"https://img.shields.io/readthedocs/django-prodserver.svg?logo=read-the-docs&logoColor=fff&style=flat-square\" alt=\"Documentation Status\">\n  </a>\n  <a href=\"https://codecov.io/gh/nanorepublica/django-prodserver\">\n    <img src=\"https://img.shields.io/codecov/c/github/nanorepublica/django-prodserver.svg?logo=codecov&logoColor=fff&style=flat-square\" alt=\"Test coverage percentage\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/astral-sh/uv\">\n    <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json\" alt=\"uv\">\n  </a>\n  <a href=\"https://github.com/astral-sh/ruff\">\n    <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Ruff\">\n  </a>\n  <a href=\"https://github.com/pre-commit/pre-commit\">\n    <img src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square\" alt=\"pre-commit\">\n  </a>\n</p>\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/django-prodserver/\">\n    <img src=\"https://img.shields.io/pypi/v/django-prodserver.svg?logo=python&logoColor=fff&style=flat-square\" alt=\"PyPI Version\">\n  </a>\n  <img src=\"https://img.shields.io/pypi/pyversions/django-prodserver.svg?style=flat-square&logo=python&amp;logoColor=fff\" alt=\"Supported Python versions\">\n  <img src=\"https://img.shields.io/pypi/l/django-prodserver.svg?style=flat-square\" alt=\"License\">\n</p>\n\n---\n\n**Documentation**: <a href=\"https://django-prodserver.readthedocs.io\" target=\"_blank\">https://django-prodserver.readthedocs.io </a>\n\n**Source Code**: <a href=\"https://github.com/nanorepublica/django-prodserver\" target=\"_blank\">https://github.com/nanorepublica/django-prodserver </a>\n\n---\n\nA management command to start production servers/workers with a consistent interface\n\n## Installation\n\nInstall this via pip (or your favourite package manager):\n\n`pip install django-prodserver`\n\nAdd the app to your `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n    # ...\n    \"django_prodserver\",\n]\n```\n\n## Configuration\n\nAdd the `PRODUCTION_PROCESSES` setting to your `settings.py`. Below shows an example with a web process and worker process defined.\n\nThe comments show other available backend processes that are available to use.\n\n```py\nPRODUCTION_PROCESSES = {\n    \"web\": {\n        \"BACKEND\": \"django_prodserver.backends.gunicorn.GunicornServer\",\n        \"ARGS\": {\"bind\": \"0.0.0.0:8111\"},\n    },\n    # \"web\": {\n    #     \"BACKEND\": \"django_prodserver.backends.waitress.WaitressServer\",\n    #     \"ARGS\": {},\n    # },\n    # \"web\": {\n    #     \"BACKEND\": \"django_prodserver.backends.uvicorn.UvicornServer\",\n    #     \"ARGS\": {},\n    # },\n    # \"web\": {\n    #     \"BACKEND\": \"django_prodserver.backends.uvicorn.UvicornWSGIServer\",\n    #     \"ARGS\": {},\n    # },\n    \"worker\": {\n        \"BACKEND\": \"django_prodserver.backends.celery.CeleryWorker\",\n        \"APP\": \"tests.celery.app\",\n        \"ARGS\": {},\n    },\n    # \"worker\": {\n    #     \"BACKEND\": \"django_prodserver.backends.django_tasks.DjangoTasksWorker\",\n    #     \"ARGS\": {},\n    # },\n}\n```\n\n## Usage\n\nOnce the `PRODUCTION_PROCESSES` setting has been configured you can then start the processes as follows:\n\n```sh\npython manage.py prodserver web\n```\n\n```sh\npython manage.py prodserver worker\n```\n\n## Creating a new backend.\n\nCreating a backend is fairly simple. Subclass the `BaseServerBackend` class, then implement\nthe `start_server` method which should call the underlying process in the best possible way for a production\nsetting. You can also optionally override `prep_server_args` method to aid with this to provide any default arguments\nor formatting to the `start_server` command.\n\nSee `django_prodserver.backends` for examples of existing backends for inspiration. Pull Request's are welcome for\nadditional backends.\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- prettier-ignore-start -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- markdownlint-disable -->\n<!-- markdownlint-enable -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- prettier-ignore-end -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## Credits\n\n[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)\n\nThis package was created with\n[Copier](https://copier.readthedocs.io/) and the\n[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)\nproject template.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A management command to start production servers/workers with a consistent interface",
    "version": "2.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/nanorepublica/django-prodserver/issues",
        "Changelog": "https://github.com/nanorepublica/django-prodserver/blob/main/CHANGELOG.md",
        "documentation": "https://django-prodserver.readthedocs.io",
        "repository": "https://github.com/nanorepublica/django-prodserver"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fd67fb4b7558e818d63006e92280e72eae1d857399c836b39f6223cfb1f3a0fe",
                "md5": "dc414adee8019b976789b1863d836ae8",
                "sha256": "c092f0f7df0bd84cb2cc0b791903a9e388700f666281a108f03440d0cf94c59e"
            },
            "downloads": -1,
            "filename": "django_prodserver-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc414adee8019b976789b1863d836ae8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 13598,
            "upload_time": "2025-08-31T01:54:27",
            "upload_time_iso_8601": "2025-08-31T01:54:27.939385Z",
            "url": "https://files.pythonhosted.org/packages/fd/67/fb4b7558e818d63006e92280e72eae1d857399c836b39f6223cfb1f3a0fe/django_prodserver-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-31 01:54:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nanorepublica",
    "github_project": "django-prodserver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-prodserver"
}
        
Elapsed time: 1.04429s