I have no need to the celery modules in my Django admin. Is there a way I could remove it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
To be more specific, in admin.py
of any app inside INSTALLED_APPS
after 'djcelery'
from django.contrib import admin
from djcelery.models import (
TaskState, WorkerState, PeriodicTask,
IntervalSchedule, CrontabSchedule)
admin.site.unregister(TaskState)
admin.site.unregister(WorkerState)
admin.site.unregister(IntervalSchedule)
admin.site.unregister(CrontabSchedule)
admin.site.unregister(PeriodicTask)
回答2:
You can simply unregister celerys models like admin.site.unregister(CeleryModelIdoNotWantInAdmin)