[Django]-How to clear Recent Actions panel on Django Admin?

48👍

âś…

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

from django.contrib.admin.models import LogEntry

LogEntry.objects.all().delete()

5👍

You can clear Recent Actions of Django Admin.

First, open Django Shell with this command below:

python manage.py shell

Then, copy & paste these 2 lines of code below to Django Shell then press "Enter". That’s it:

from django.contrib.admin.models import LogEntry
LogEntry.objects.all().delete()

0👍

Run in command prompt : python manage.py shell

Then type these lines one by one:

from django.contrib.admin.models import LogEntry
LogEntry.objects.all().delete()

and after excuting these lines type this line inside the shell to exit the shell:

exit()

Leave a comment