Friskes / celery-starter

Django command to run celery (worker, beat, flower) with automatically reboot server after changing files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django command to run celery (worker, beat, flower) with automatically reboot server after changing files

Project Status
CI/CD Latest Release
Quality Coverage
Package PyPI - Version PyPI - Support Python Versions Project PyPI - Downloads
Meta types - Mypy License - MIT code style - Ruff

Install

  1. Install package

    pip install celery-starter
  2. Add app name to INSTALLED_APPS

    INSTALLED_APPS = [
        'celery_starter',
    ]

Command to run the program:

python manage.py runcelery

Arguments can be passed in any order, it doesn't matter.

Positional Arguments:

<celery app name> or <"full command to run celery worker">

Optional Arguments:

-h or --help Show help message.
-b or --beat Excludes the beat server at startup.
-f or --flower Excludes the flower server at startup.
-d or --debug Displays information about successful/unsuccessful completion of processes.
-ll or --loglevel Defines the logging level for celery worker/beat -lf or --logfile Redirects the output to the console by default to a log file for celery worker/beat

To stopped program pressing the keyboard shortcut CTRL+C

Examples of Commands

The command enclosed in quotation marks gets into the positional arguments and replaces the command to run the default celery worker. The --beat --flower commands fall into the optional arguments and turn off the beat and flower of the server.

python manage.py runcelery "celery --app=${CELERY_APP} worker -E \
--hostname=worker-example@%h
--uid=nobody --gid=nogroup \
--loglevel=INFO" --beat --flower

About

Django command to run celery (worker, beat, flower) with automatically reboot server after changing files

License:MIT License


Languages

Language:Python 100.0%