2

I am looking for an option to use in my Django 1.10 web project where I need to run some task every hour. I know I can use DJCELERY but it is not updated for Django 1.10 and I am getting these errors,

Error fetching command 'celerymon': type object 'BaseCommand' has no attribute 'option_list'
Command 'celerymon' skipped
Error fetching command 'celerybeat': type object 'BaseCommand' has no attribute 'option_list'
Command 'celerybeat' skipped
Error fetching command 'celeryd_multi': type object 'BaseCommand' has no attribute 'option_list'
Command 'celeryd_multi' skipped
Error fetching command 'celeryd': type object 'BaseCommand' has no attribute 'option_list'
Command 'celeryd' skipped
Error fetching command 'celerycam': type object 'BaseCommand' has no attribute 'option_list'
Command 'celerycam' skipped
Error fetching command 'celery': type object 'BaseCommand' has no attribute 'option_list'
Command 'celery' skipped
Error fetching command 'celeryd_detach': type object 'BaseCommand' has no attribute 'option_list'
Command 'celeryd_detach' skipped
Error fetching command 'djcelerymon': type object 'BaseCommand' has no attribute 'option_list'
Command 'djcelerymon' skipped

So is there any other option that I can use to run task(s) in background? Does django offer anything like this in new version?

Thank you.

Amit Pandya
  • 361
  • 1
  • 3
  • 19
  • If `celery` is not your option, just use `cronjob`. – Shang Wang Nov 18 '16 at 15:56
  • django's cronjob? – Amit Pandya Nov 18 '16 at 15:58
  • No, linux cronjob. You could create a python script that does what you want and put that in cronjob. The other option is downgrade your django. I believe earlier django version should have pretty much all you need as well. – Shang Wang Nov 18 '16 at 16:01
  • I cannot downgrade. I am using same thing on our Windows server where my company's project is running. We are migrating it to Linux server and so I wanted to know other options. I think I will do same thing, python script for task. – Amit Pandya Nov 18 '16 at 16:03
  • django-cronjob can help in the setup of the cronjobs btw – EsseTi Nov 18 '16 at 16:05
  • `django-cronjob` doesn't work on windows. I believe windows should have similar thing as crontab, but can't speak of it because I never used it. – Shang Wang Nov 18 '16 at 16:09
  • We are migrating our website to Linx server so can I use `django cronjob`? On Windows server I was able to monitor my Python script using GUI but on Linux server we are not using GUI and everything will be command line. And at some point my terminal will close connection due to inactivity so I wont be able to monitor my script – Amit Pandya Nov 18 '16 at 16:13

1 Answers1

3

You can use Celery 4, which doesn't require django-celery and is compatible with Django 1.10. Read the Celery Documentation to see how it's integrated with Django.

Steffen
  • 140
  • 6