L
L
Leo2015-02-17 17:08:24
Django
Leo, 2015-02-17 17:08:24

How to show periodic tasks in Django admin?

Installed django-celery , created a scheduled task:

@periodic_task(run_every=datetime.timedelta(minutes=1))
def test():
    print 'test task'
    return True

Next I command (the broker is running, rabbitmq):
python manage.py runserver
celery -A app worker -l info -B
python manage.py celerycam --frequency=10.0

In the admin panel, I see a worker with the Online status , but the Periodic tasks is empty, although the worker log shows that the tasks are running:
Task app.celery.test[a82425bb-400e-477e-9a6b-1f2e68f30713] succeeded in 0.00270485699912s: True

As I understand it, django-celery is needed just to create tasks through the admin panel and see which ones have already been completed and are being performed.
Why does my periodic_task not appear in the admin and how to fix it?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2015-02-17
@STLEON

In settings.py

CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question