Calling Django custom management command using Celery and Redis outputs "Unknown command" error

Viewed 279

I am trying to call a function asynchronously in Django using Celery and Redis as a message broker. I am calling a function that calls call_command() to execute a custom management command I made.

@app.task
def processVideo(url):
   management.call_command('analyzevideos', url)

However, calling processVideo.delay(url) produces the following error:

django.core.management.base.CommandError: Unknown command: 'analyzevideos'

I'm not sure why this error is occurring since calling management.call_command('analyzevideos', url) in the Python shell works perfectly fine.

This question is similar to this one that has no answers.

0 Answers
Related