How can I disable the Django Celery admin modules?

2019-02-03 15:44发布

I have no need to the celery modules in my Django admin. Is there a way I could remove it?

2条回答
萌系小妹纸
2楼-- · 2019-02-03 16:12

You can simply unregister celerys models like admin.site.unregister(CeleryModelIdoNotWantInAdmin)

查看更多
Melony?
3楼-- · 2019-02-03 16:18

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)
查看更多
登录 后发表回答