Skip to main content

django DaemonCommand

Project description

Installation

$ [sudo] pip install django-daemon-command

Pros

  • never stops after exception
    • exception traceback is saved in the database (SELECT * FROM daemon_command_exc_traceback)
  • logs (SELECT * FROM daemon_command_log)

Settings

INSTALLED_APPS = [
    ...
    'django_daemon_command',
    ...
]
$ python manage.py migrate

Examples

app/management/commands/command.py

from django_daemon_command.management.base import DaemonCommand

class Command(DaemonCommand):
    sleep = 5

    def process(self,*args,**options):
        self.log('msg') # SELECT * FROM daemon_command_log
$ python manage.py command

customize

class Command(DaemonCommand):
    def handle(self, *args, **options):
        ... # init
        self.daemonize(*args, **options)

    def on_exception(self,exc):
        self.print_exception(exc)
        self.save_exception(exc)

python-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-daemon-command, version 2020.4.18
Filename, size File type Python version Upload date Hashes
Filename, size django-daemon-command-2020.4.18.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page