I am building the system in Django rest framework, in which the admin level user will govern the local users , I need to keep track of lower level users activity, example: s user activity such as adding some post or deleting and so on other lots of activities. Is there any package or any good implementation on how it can be achieved ?
Advertisement
Answer
You can access the Track Log
of Admin
activities like :-
JavaScript
x
6
1
from django.contrib.admin.models import LogEntry
2
3
logs = LogEntry.objects.all() # You can also filter
4
for l in logs:
5
#access or perform actions
6
Edit :-
To access the time of activity or action. You can access it by action_time:-
JavaScript
1
4
1
logs = LogEntry.objects.all() # You can also filter
2
for l in logs:
3
actionTime = l.action_time # Changed Here
4
It will show the time of action made by user