[英]Best practice to update Django contrib
I'd like to make some changes to def login
and def logout
in django.contrib.auth
__init.py__
. 我想在django.contrib.auth
__init.py__
对def login
和def logout
进行一些更改。 Specifically I want to add a mixpanel event to user login and logout. 具体来说,我想向用户登录和注销添加一个mixpanel事件。
I know I can do this by editing the file directly, although I assume this is not recommended due to version control / etc. 我知道我可以通过直接编辑文件来做到这一点,尽管我认为由于版本控制/等原因不建议这样做。
What's the best / easiest way to override these functions cleanly? 彻底重写这些功能的最佳/最简单方法是什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.