File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import absolute_import
2+
3+ from .celery import app as celery_app
4+
5+ __all__ = ['celery_app' ]
Original file line number Diff line number Diff line change 1+ from __future__ import absolute_import
2+ import os
3+ from celery import Celery , shared_task
4+
5+ from django .conf import settings
6+
7+ os .environ .setdefault ('DJANGO_SETTINGS_MODULE' , 'project.settings' )
8+ app = Celery ('project' )
9+
10+ app .config_from_object ('django.conf:settings' )
11+ app .autodiscover_tasks ()
12+
13+
14+ @app .task (bind = True )
15+ def debug_task (self ):
16+ print ('Request: {0!r}' .format (self .request ))
17+
18+ from celery import shared_task
19+
20+ @shared_task ()
21+ def example_task (first_arg , second_arg ):
22+ print ('Hello' )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments