How can I disable the Django Celery admin modules?

前端 未结 2 462
粉色の甜心
粉色の甜心 2020-12-29 14:36

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

相关标签:
2条回答
  • 2020-12-29 14:40

    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)
    
    0 讨论(0)
  • 2020-12-29 14:40

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

    0 讨论(0)
提交回复
热议问题