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.

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.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

django_command_server-0.1.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file django-command-server-0.1.2.tar.gz.

File metadata

  • Download URL: django-command-server-0.1.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for django-command-server-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6941c031bb815b23d09f58e92908be5abbc7a3791ce60ca625a1efaa68403ca6
MD5 474946bf24b34f5902d616c576b29034
BLAKE2b-256 4b8876cb9a9eeed76bd7034826b7a8ef5b884772c13123465f7a36d68d255c6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_command_server-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cd48f7d2a77f69100524d55288df02ef0d86f380db6f41291030e122eadc8c0
MD5 cb286043e8793173af802859ba50fc40
BLAKE2b-256 847bfd5d6e630cc6393e62799eeb99531876234e14050ab103da321d888e41db

See more details on using hashes here.

Supported by

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