28

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

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

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Deepend
  • 4,057
  • 17
  • 60
  • 101

3 Answers3

47

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()
pcoronel
  • 3,833
  • 22
  • 25
  • 12
    Worked a charm. Just for clarification I made sure i wan in the project directory and then ran this from the Django shell. `python manage.py shell` and just typed the above two lines. Worked perfectly once i restarted. – Deepend May 07 '14 at 16:55
4

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()
Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
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()
Himaloy Mondal
  • 127
  • 2
  • 6