0

I have this warning, when do runcrones with manage.py. Where am I doing wrong?

site-packages/django/core/management/init.py:345: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead self.fetch_command(subcommand).run_from_argv(self.argv)

cron.py

from django_cron import CronJobBase, Schedule

class UnbanCron(CronJobBase):
    RUN_EVERY_MINS = 5

    schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
    code = 'board.unban_cron'

    def do(self):
        print("CRON WORKS")

settings of django_crone in settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_bleach',
    'snowpenguin.django.recaptcha2',
    'django_cron',
    'board',
]

CRON_CLASSES = [
    "board.cron.UnbanCron",
]
umaru
  • 178
  • 11
  • 3
    To be honest there is nothing for you to do. Django-cron needs to be updated to make sure they do not use any deprecated code. You can check for updates to the package. Generally it is always better use the latest version of any package. – Resley Rodrigues Aug 14 '16 at 17:30
  • 1
    See [this issue](https://github.com/Tivix/django-cron/issues/75) for the django-cron repository. – Alasdair Aug 14 '16 at 19:08

0 Answers0