15

I was wondering if I can get django admin (logged as super user) to display in some kind of "recent actions box", changes other users (non super users) made?

Thanx,

Luka

Luka
  • 151
  • 1
  • 1
  • 3

2 Answers2

8

LogEntry.objects.log_action()

http://www.djangosnippets.org/snippets/1052/

Tying in to Django Admin's Model History

Community
  • 1
  • 1
Yaroslav
  • 2,718
  • 17
  • 16
0

it was my problem too, and it has a simple answer Just go this address and do the following; Address: your virtulenv/lib/site-packages/django/contrib/admin/templates/admin

And find base.html, inside of this file edit after {% load Log %} and simply add this :

{% if user.is_superuser %}
    {% get _admin_log (numbers of actions you want) as admin_log %}

And for the else do the same but at the end don't forget to add for_user user

Ankit Tiwari
  • 4,438
  • 4
  • 14
  • 41
mh-firouzjah
  • 834
  • 1
  • 6
  • 15
  • 3
    You should not edit this file directly, instead override it with a local version in your app/project. Also I currently show the location of get_admin_log as index.html instead of base.html. – bparker May 20 '19 at 16:39