File tree 2 files changed +77
-0
lines changed
2 files changed +77
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,46 @@ You can use the ``enabled`` flag to temporarily disable a periodic task::
192
192
>>> periodic_task.enabled = False
193
193
>>> periodic_task.save()
194
194
195
+
196
+ Example running periodic tasks
197
+ -----------------------------------
198
+
199
+ The periodic tasks still need 'workers' to execute them.
200
+ So make sure the default **Celery ** package is installed.
201
+ (If not installed, please follow the installation instructions
202
+ here: https://github.com/celery/celery)
203
+
204
+ Both the worker and beat services need to be running at the same time.
205
+
206
+ 1. Start a Celery worker service (specify your Django project name)::
207
+
208
+
209
+ $ celery -A [project-name] worker --loglevel=info
210
+
211
+
212
+ 2. As a separate process, start the beat service (specify the Django scheduler)::
213
+
214
+
215
+ $ celery -A [project-name] beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
216
+
217
+
218
+ **OR** you can use the -S (scheduler flag), for more options see ``celery beat --help ``)::
219
+
220
+ $ celery -A [project-name] beat -l info -S django
221
+
222
+
223
+ Also, as an alternative, you can run the two steps above (worker and beat services)
224
+ with only one command (recommended for **development environment only **)::
225
+
226
+
227
+ $ celery -A [project-name] worker --beat --scheduler django --loglevel=info
228
+
229
+
230
+ 3. Now you can add and manage your periodic tasks from the Django Admin interface.
231
+
232
+
233
+
234
+
195
235
Installation
196
236
============
197
237
Original file line number Diff line number Diff line change @@ -183,3 +183,40 @@ You can use the ``enabled`` flag to temporarily disable a periodic task::
183
183
184
184
>>> periodic_task.enabled = False
185
185
>>> periodic_task.save()
186
+
187
+
188
+ Example running periodic tasks
189
+ -----------------------------------
190
+
191
+ The periodic tasks still need 'workers' to execute them.
192
+ So make sure the default **Celery** package is installed.
193
+ (If not installed, please follow the installation instructions
194
+ here: https://github.com/celery/celery)
195
+
196
+ Both the worker and beat services need to be running at the same time.
197
+
198
+ 1. Start a Celery worker service (specify your Django project name)::
199
+
200
+
201
+ $ celery -A [project-name] worker --loglevel=info
202
+
203
+
204
+ 2. As a separate process, start the beat service (specify the Django scheduler)::
205
+
206
+
207
+ $ celery -A [project-name] beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
208
+
209
+
210
+ **OR** you can use the -S (scheduler flag), for more options see ``celery beat --help ``)::
211
+
212
+ $ celery -A [project-name] beat -l info -S django
213
+
214
+
215
+ Also, as an alternative, you can run the two steps above (worker and beat services)
216
+ with only one command (recommended for **development environment only**)::
217
+
218
+
219
+ $ celery -A [project-name] worker --beat --scheduler django --loglevel=info
220
+
221
+
222
+ 3. Now you can add and manage your periodic tasks from the Django Admin interface.
You can’t perform that action at this time.
0 commit comments