celery added for asynchronus working of voice separation
This commit is contained in:
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
from celery_app import app as celery
|
||||||
|
|||||||
@@ -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()
|
|
||||||
@@ -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()
|
||||||
Reference in New Issue
Block a user