开发者

Django / Python, calling a specific class / function on every user Request

开发者 https://www.devze.com 2023-01-17 18:02 出处:网络
I was looking over the Django documentation on a way to do this but didn\'t see anything, though I may have missed it as I\'m not sure exactly where to look... I want to be able to perfor开发者_开发百

I was looking over the Django documentation on a way to do this but didn't see anything, though I may have missed it as I'm not sure exactly where to look... I want to be able to perfor开发者_开发百科m a specific action on every user request, such as instantiating a class and calling one of its functions, however the only way I know of to do this now is to put it in each view function. Is there a better way to do this, any advice is appreciated.


You want to use Django's middleware functionality.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号