[Answered ]-Django run code once on every successful login

2👍

I’m not sure why you can’t put it in the view that processes the login itself. You’ve certainly written something that takes the output from the username/password form and calls auth.login(), so that would seem to be the right place to do it.

Alternatively, you could write a signal listener for the user_logged_in signal.

Leave a comment