Skip to main content

Django command to launch celery worker, beat, flower

Project description

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.

Optional Arguments:

-h or --help Show help message.
-w or --worker Full command line to run worker or options that extend the default command line.
-b or --beat Full command line to run beat or options that extend the default command line.
-f or --flower Full command line to run flower or options that extend the default command line.
-eb or --exclude-beat Excludes the beat server at startup.
-ef or --exclude-flower Excludes the flower server at startup.
-d or --debug Displays information about successful/unsuccessful completion of processes.

To stopped program pressing the keyboard shortcut CTRL+C

Examples of Commands

default commands:

# worker cmd
celery -A <CELERY_APP> worker -E -l INFO -P gevent

# beat cmd
celery -A <CELERY_APP> beat --pidfile=celerybeat.pid -l INFO

# flower cmd
celery --broker=redis://localhost:6379// flower -A <CELERY_APP> --url_prefix=flower

valid commands:

# redefining the -A and -P parameter and adding a new --broker parameter to the default worker command
python manage.py runcelery -w "-A <CELERY_APP> -P solo --broker=redis://localhost:6379//"

# complete replacement of the default worker command with the passed command
python manage.py runcelery -w "celery -A <CELERY_APP> worker"

Working with beat and flower commands works in a similar way.

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

celery_starter-1.0.6.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

celery_starter-1.0.6-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file celery_starter-1.0.6.tar.gz.

File metadata

  • Download URL: celery_starter-1.0.6.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for celery_starter-1.0.6.tar.gz
Algorithm Hash digest
SHA256 9649836902a89bb8fa97c261db1a45aa3b1d8ecd9120e94283ec8bd74cc03fe7
MD5 58dcf518a3557f0531e3a05cf50546cc
BLAKE2b-256 d6b5ef0c5d817651b485b12bbfa7f7fa64d1efedb82b149cefd78285dc5be80a

See more details on using hashes here.

File details

Details for the file celery_starter-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for celery_starter-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c65785273c12f61983bb36a76d48e0b13cb84bb76ced6c44f34f8279f8aa2097
MD5 30610830fa314a6eff3d80951a0b28b0
BLAKE2b-256 dfa738e94551416838ed800f5c246cd5ca52e33ff5b1a248bdb3015b5348a093

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