first commit
This commit is contained in:
18
core/celery.py
Normal file
18
core/celery.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
from celery import Celery
|
||||
|
||||
# Django ayarlarını yükle
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
|
||||
|
||||
app = Celery('core')
|
||||
|
||||
# Django ayarlarından 'CELERY_' ile başlayanları al
|
||||
app.config_from_object('django.conf:settings', namespace='CELERY')
|
||||
|
||||
# Tüm uygulamalardaki tasks.py dosyalarını otomatik keşfet
|
||||
app.autodiscover_tasks()
|
||||
|
||||
|
||||
@app.task(bind=True)
|
||||
def debug_task(self):
|
||||
print(f'Request: {self.request!r}')
|
||||
Reference in New Issue
Block a user