Added celerity background process

This commit is contained in:
2025-02-14 19:39:23 +01:00
parent 595b7a2a17
commit 65716ff842
5 changed files with 83 additions and 59 deletions

15
backend/celery.py Normal file
View File

@@ -0,0 +1,15 @@
# backend/celery.py
import os
from celery import Celery
# Set the default Django settings module
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
# Create the Celery app
app = Celery('backend')
# Load configuration from Django settings
app.config_from_object('django.conf:settings', namespace='CELERY')
# Discover tasks in all installed apps
app.autodiscover_tasks()