Files
dj52/core/celery.py
Beyhan Oğur ec28a2024d first commit
2026-04-26 22:22:29 +03:00

19 lines
450 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 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}')