Skip to main content

Django management.command is running a long live task, we make it a linux daemon server, so that you can start, stop, restart the task.

Project description

django-command-server

Django management.command is running a long live task, we make it a linux daemon server, so that you can start, stop, restart the task.

Install

pip install django-command-server

Usage

app/management/commands/helloserver.py

import djclick as click
from django_command_server import DjangoCommandServer

class HelloServer(DjangoCommandServer):
    def main(self):
        while True:
            print("hello")

@click.group()
def main():
    pass

hello_server = HelloServer()
hello_server.setup(main)

Notes:

  • django_command_server is not a django application, do do NOT include it in django's INSTALLED_APPS.
  • DjangoCommandServer setup takes a djclick.group(), so create an instance and pass it to setup.
  • Implement your own server main.

Release

v0.1.0 2020/11/09

  • First release.

v0.1.1 2020/11/09

  • Add deps in requirements.txt.

v0.1.2 2023/09/18

  • Doc update.

v0.1.3 2025/10/23

  • Doc update.

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

django_command_server-0.1.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_command_server-0.1.3-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file django_command_server-0.1.3.tar.gz.

File metadata

  • Download URL: django_command_server-0.1.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for django_command_server-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a968ef235c4b5fed7a0ae35cec15870429cf88e66b2fc667579d1bc52a57c48d
MD5 52c3df06de655d354cc94704920230d2
BLAKE2b-256 8bb7b1f02855b305be3c9e023953a96b7210824cee050189095667894dde162d

See more details on using hashes here.

File details

Details for the file django_command_server-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_command_server-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 64d1255a64531f687f128e06e5cd9702279eedc8bc4f2016d9aa84b95b522721
MD5 820adddbd0dbe6d786f08f777e62093e
BLAKE2b-256 56ee9fa1c9667eaca4d5e6f128cbd6c515a42cb16f792aa07c0a3c73b75e0b95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page