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
Benefits of using this cli
- The ability to run up to three servers (worker, beat, flower) simultaneously in one terminal, instead of running by default in three different terminals.
- Automatic reboot of these servers when your codebase changes.
Install
-
Install package
pip install celery-starter
-
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 <cmd>
or --worker <cmd>
Full command line to run worker or options that extend the default command line.
-b <cmd>
or --beat <cmd>
Full command line to run beat or options that extend the default command line.
-f <cmd>
or --flower <cmd>
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
# (WARNING) Note that the default pool is solo,
# because of this, all tasks will be performed sequentially,
# to get parallelism, install one of the libraries [gevent | eventlet]
# and redefine the default pool in cmd.
celery -A <CELERY_APP> worker -E -l INFO -P solo
# 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 gevent --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.
Contributing
We would love you to contribute to celery-starter
, pull requests are very welcome! Please see CONTRIBUTING.md for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file celery_starter-1.0.9.tar.gz
.
File metadata
- Download URL: celery_starter-1.0.9.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca1e14c02b904fe4643a0cd3e8e3da80a5ff269989214028f09ee64ee03a7a66 |
|
MD5 | 71ad506bac71f69213c1cf05837f21bf |
|
BLAKE2b-256 | 9e776161872dfbf9cf766a7d404e3adf6921229d1aaa73e28b0f79f02442d5f7 |
Provenance
The following attestation bundles were made for celery_starter-1.0.9.tar.gz
:
Publisher:
publish-to-pypi.yml
on Friskes/celery-starter
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
celery_starter-1.0.9.tar.gz
- Subject digest:
ca1e14c02b904fe4643a0cd3e8e3da80a5ff269989214028f09ee64ee03a7a66
- Sigstore transparency entry: 152597102
- Sigstore integration time:
- Permalink:
Friskes/celery-starter@19c2b5195b767440a88c7f77f6f04e92b7d902d8
- Branch / Tag:
refs/tags/v1.0.9
- Owner: https://github.com/Friskes
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish-to-pypi.yml@19c2b5195b767440a88c7f77f6f04e92b7d902d8
- Trigger Event:
push
- Statement type:
File details
Details for the file celery_starter-1.0.9-py3-none-any.whl
.
File metadata
- Download URL: celery_starter-1.0.9-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e0a456d097b0f29c664172e192328826b010e473f6bbe7106694ab72a4b893b |
|
MD5 | d46c9f3a0ecb918c0b0f1b87e41c674c |
|
BLAKE2b-256 | 738172974600c6867a5f0c45142c4424d1c07c4c3641c13d0e9b9fe52ad45229 |
Provenance
The following attestation bundles were made for celery_starter-1.0.9-py3-none-any.whl
:
Publisher:
publish-to-pypi.yml
on Friskes/celery-starter
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
celery_starter-1.0.9-py3-none-any.whl
- Subject digest:
7e0a456d097b0f29c664172e192328826b010e473f6bbe7106694ab72a4b893b
- Sigstore transparency entry: 152597103
- Sigstore integration time:
- Permalink:
Friskes/celery-starter@19c2b5195b767440a88c7f77f6f04e92b7d902d8
- Branch / Tag:
refs/tags/v1.0.9
- Owner: https://github.com/Friskes
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish-to-pypi.yml@19c2b5195b767440a88c7f77f6f04e92b7d902d8
- Trigger Event:
push
- Statement type: