Frage

I am using Django's default authentication system to run my website. So whenever a user logs in in urls.py I have -

(r'^login/$', 'django.contrib.auth.views.login'),

I guess django uses django.contrib.auth.login & django.contrib.auth.authenticate to login.

Now as part of some requirement I am needed to run some function calls just after a user logs in. How do i do that ?

War es hilfreich?

Lösung

Just include a signal function. Whenever a user logs in, django fires a signal and your function will be called.

Refer the documentation on auth signals.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top