Django Admin:如何清除“最近的动作”面板

时间:2022-09-12 09:05:04

How would I go about clearing or re-setting the "Recent Actions" Panel in the Django Admin?

我将如何清除或重新设置Django Admin中的“Recent Actions”面板?

I want the admin interface to look like a fresh install.

我希望管理界面看起来像一个全新的安装。

Thanks

谢谢

1 个解决方案

#1


14  

The "Recent Actions" panel in Django Admin displays LogEntry models. To clear it you would just delete all the objects:

Django Admin中的“Recent Actions”面板显示LogEntry模型。要清除它,您只需删除所有对象:

from django.contrib.admin.models import LogEntry

LogEntry.objects.all().delete()

#1


14  

The "Recent Actions" panel in Django Admin displays LogEntry models. To clear it you would just delete all the objects:

Django Admin中的“Recent Actions”面板显示LogEntry模型。要清除它,您只需删除所有对象:

from django.contrib.admin.models import LogEntry

LogEntry.objects.all().delete()