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

Requirements

  • django>=4.2.11 celery>=5.3.6 python-dotenv>=1.0.1

Install

  1. 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

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

Uploaded Source

Built Distribution

celery_starter-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: celery_starter-1.0.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for celery_starter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c33c1fbca7b6f5eac52b270946cfc5460b5476e7b75f484e7afe47afa6e60bb7
MD5 ff05a43cf137d2cdd6b7645ac6b02c95
BLAKE2b-256 cbd394a4659bbd5a0faa6af06a8252c6ac0d4c7428094288372c01d1c7d29b9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for celery_starter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52b0f0160cb9f2786088bbab2fa81a01ea0befa0f8356696c57a2c76d0e97325
MD5 b9be2689b699e448d4aaf415a1527fc6
BLAKE2b-256 5c0a8af08bd64c036261c9ca802af9c7b64c896d31dd9b02038e60ba71f12a5f

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