celery added for asynchronus working of voice separation

This commit is contained in:
karthikeyan-ks
2025-01-08 01:09:50 +05:30
parent 10181e4d17
commit 889630d7f1
5 changed files with 22 additions and 16 deletions
+12
View File
@@ -0,0 +1,12 @@
from django import forms
class UploadFileForm(forms.Form):
file = forms.FileField(label='Select a file')
# You can add custom validation if needed
def clean_file(self):
file = self.cleaned_data.get('file')
if not file:
raise forms.ValidationError("No file uploaded!")
# Additional custom validations can be added here
return file
+1
View File
@@ -0,0 +1 @@
from celery_app import app as celery
-16
View File
@@ -1,16 +0,0 @@
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
app = Celery('backend')
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# Namespace 'CELERY' means all celery-related configs must start with 'CELERY_'
app.config_from_object('django.conf:settings', namespace='CELERY')
# Load task modules from all registered Django app configs.
app.autodiscover_tasks()
+9
View File
@@ -0,0 +1,9 @@
from celery import Celery
app = Celery('backend')
# Load configuration from Django settings, using the CELERY namespace.
app.config_from_object('django.conf:settings', namespace='CELERY')
# Autodiscover tasks from installed apps.
app.autodiscover_tasks()