Django管理面板HealthCheck
我想为我的Django管理面板创建一个HealthCheck端点。 我想通过admin.site.register_view
进行注册软件包),但我不知道如何使公众可以访问它,而无需先验证。
有什么想法吗?
I want to create a healthcheck endpoint for my django admin panel.
I want to register it via admin.site.register_view
(I am using the adminplus package) but I can't figure out how to made it accessible to the public, without the need to authenticate first.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,我最终在
adminplusmixin
的子类中结束了def has_permission(self,request)
:So I ended up overriding
def has_permission(self, request)
in subclass ofAdminPlusMixin
:我相信软件包已经过时了,相反,您可以做以下操作:
在 models.py 中创建一个代理模型,例如:
它只是一个 mysql视图,即创建的从AM现有表
,最后在 admin.py 中
,以此方式显示在您正在使用的应用程序中。
您所拥有的是您的视图中的函数。
I believe that package is outdated, instead you could do something like the following:
Created a proxy model in models.py such as:
Which is just a mysql view that a created from am existing table
And finally in admin.py
This way it will show in the admin panel, inside the app you're working on.
Probably what you have is a function in your views.py, in this case you should replace that function content where the "..." are in the LabelAdmin class.