I am making a django application. To calculate the rank of the feeds based on lines and comment, I am trying to use django-background-tasks. the function I am using in nodes
You should run python manage.py process_tasks as described here. You can add it to crontab to execute periodically.
UPD:
process_tasks using crontab cause this command internally sleeps every 5 seconds (this value is configurable) and then again checks whether there is any task to run.id of model inside it, fetch object by id do calculations and save your object.