我有这个警告,什么时候用manage.py做runcron。我在哪里做错了?
站点包/ django的/型芯/管理/的初始化的.py:345: RemovedInjjango110Warning:Django管理的OptionParser用法 不推荐使用命令,而是使用ArgumentParser self.fetch_command(子命令).run_from_argv(self.argv)
cron.py
来自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.py
中django_crone的设置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",
]