Coverage for sites/ptf_tools/ptf_tools/celery.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-05-19 19:20 +0000

1import os 

2 

3from celery import Celery 

4 

5# set the default Django settings module for the 'celery' program. 

6os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ptf_tools.settings") 

7 

8app = Celery("ptf_tools") 

9 

10# Using a string here means the worker don't have to serialize 

11# the configuration object to child processes. 

12# - namespace='CELERY' means all celery-related configuration keys 

13# should have a `CELERY_` prefix. 

14app.config_from_object("django.conf:settings", namespace="CELERY") 

15 

16# Load task modules from all registered Django app configs. 

17app.autodiscover_tasks()