Files
atabackend/core/celery.py
Beyhan Oğur d50f14bcb1 first commit
2026-04-26 22:20:45 +03:00

20 lines
490 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import os
from celery import Celery
# Django settings modülünü ayarla
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
app = Celery('core')
# Django settings'ten celery yapılandırmasını yükle
app.config_from_object('django.conf:settings', namespace='CELERY')
# Tüm Django app'lerden tasks.py dosyalarını otomatik olarak keşfet
app.autodiscover_tasks()
@app.task(bind=True, ignore_result=True)
def debug_task(self):
print(f'Request: {self.request!r}')