Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Admin: How to clear Recent Actions panel

Tags:

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.

like image 939
Deepend Avatar asked May 07 '14 14:05

Deepend


People also ask

How can I remove extra's from Django admin panel?

Take a look at the Model Meta in the django documentation. Within a Model you can add class Meta this allows additional options for your model which handles things like singular and plural naming. Show activity on this post. inside model.py or inside your customized model file add class meta within a Model Class.

Can we customize Django admin panel?

The Django admin is a powerful built-in tool giving you the ability to create, update, and delete objects in your database using a web interface. You can customize the Django admin to do almost anything you want.

How use Django admin panel?

To login to the site, open the /admin URL (e.g. http://127.0.0.1:8000/admin ) and enter your new superuser userid and password credentials (you'll be redirected to the login page, and then back to the /admin URL after you've entered your details).

How do you remove save and add another Django admin?

The simplest option is to set save_as=True on the ModelAdmin . This will replace the "Save and add another" button with a "Save as new" button.


1 Answers

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() 
like image 125
pcoronel Avatar answered Sep 20 '22 18:09

pcoronel