0

I use django-background-tasks to run some heavy tasks in the background in my Django application. On my local machine everything works fine. However, if I deploy my application in production with Apache and mod_wsgi, the scheduled tasks are not executed. Instead, if I run the command

python manage.py process_tasks 

in some terminal, the message

'Failed to retrieve tasks. Database unreachable.' 

is printed every 5 sec or so.

What am I doing wrong? Where/how am I supposed to run "python manage.py process_tasks"?

1 Answer 1

0

You need to use cron service

 * * * * * /path/to/virtualenv/bin/python /path/to/project/manage.py process_tasks 

you can learn more https://opensource.com/article/17/11/how-use-cron-linux

Sign up to request clarification or add additional context in comments.

1 Comment

This just repeatedly executes the process_tasks command, while still getting the 'Failed to retrieve tasks. Database unreachable.' error.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.