mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-18 20:41:03 +03:00
- Change celery app to not be a Django app, more like a WSGI app - Define a Celery task in the Django users app - Write a test to execute the task - Update scripts to use the new app to start workers - Update documentation Fix #865
12 lines
235 B
Python
12 lines
235 B
Python
from django.contrib.auth import get_user_model
|
|
|
|
from config import celery_app
|
|
|
|
User = get_user_model()
|
|
|
|
|
|
@celery_app.task()
|
|
def get_users_count():
|
|
"""A pointless Celery task to demonstrate usage."""
|
|
return User.objects.count()
|