Django: signal when user logs in?
问题 In my Django app, I need to start running a few periodic background jobs when a user logs in and stop running them when the user logs out, so I am looking for an elegant way to get notified of a user login/logout query user login status From my perspective, the ideal solution would be a signal sent by each django.contrib.auth.views.login and ... views.logout a method django.contrib.auth.models.User.is_logged_in() , analogous to ... User.is_active() or ... User.is_authenticated() Django 1.1.1