管理面板最近的操作

发布于 2024-08-30 05:59:27 字数 94 浏览 3 评论 0原文

我想知道是否可以让 django admin(以超级用户身份登录)显示在某种“最近操作框”中,其他用户(非超级用户)所做的更改?

谢谢,

卢卡

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

瑾夏年华 2024-09-06 05:59:27

这也是我的问题,它有一个简单的答案
只需转到该地址并执行以下操作即可;
地址:your virtulenv/lib/site-packages/django/contrib/admin/templates/admin

并在其中找到 base.html{% load Log %} 之后编辑文件并简单地添加以下内容:

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

对于 else 执行相同的操作,但最后不要忘记添加 for_user 用户

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 ????

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文