Added celerity background process
This commit is contained in:
15
backend/celery.py
Normal file
15
backend/celery.py
Normal 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()
|
||||
Reference in New Issue
Block a user