mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-26 16:30:39 +03:00
Switch to celery.shared_task (#4881)
* Switch to celery.shared_task * Sort impots --------- Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
This commit is contained in:
parent
70cde064d4
commit
a247d8f8a2
|
@ -1,8 +1,9 @@
|
||||||
from config import celery_app
|
from celery import shared_task
|
||||||
|
|
||||||
from {{ cookiecutter.project_slug }}.users.models import User
|
from {{ cookiecutter.project_slug }}.users.models import User
|
||||||
|
|
||||||
|
|
||||||
@celery_app.task()
|
@shared_task()
|
||||||
def get_users_count():
|
def get_users_count():
|
||||||
"""A pointless Celery task to demonstrate usage."""
|
"""A pointless Celery task to demonstrate usage."""
|
||||||
return User.objects.count()
|
return User.objects.count()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user