Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我认为这很容易弄清楚,但我找不到任何例子。
每当用户登录到 Django Admin 时,我只想运行一个函数。
有django.contrib.auth.signals.user_logged_in信号。如果您只想为管理员登录调用该函数,请根据您的管理员 urlconf 检查请求。
django.contrib.auth.signals.user_logged_in