-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEebuU+YUjAYDi5XqPl7dbq4VHW2sFAl02CeEACgkQl7dbq4VH
W2uy0w//S8KU51+5zHieyXcvyDjEpuv9oVzNbj8NZgqEtAeqHEsUdKe9/YqPG2IH
BX5HA55Q6EunPUomZNIS8+ZSRUq3z8SBAFaORnP7MbpH0Gxr8V/g9BtGQZW6kvG1
tOu3MghH6KJe6ZbiRFKlm8JFP7nxW3yBHpCv+rG5QiOC+aOFlsAQffEt6F6QyvAQ
28FtSzlBnVCxqymToTr1OYlIQQSS5iVRMd32zlYE6AwsO6GkB/rmwwPMo2nS1jwz
AIfdAwfo78KjHvJPZhL315AEwcbIP2aqWy0JEEzY8D3keUtgwj5fp/QH+f3yKSed
ACExAIgegTROBzGZGr5Md/Y5sNslmuYfblMZaukQVYiTgsdDS7jFPrjUQGv+Qoqf
mbtBsGihlxzbUo8o99LH5I42I1ZCfJphIY7jA+J35BoHfX4p2Xt+aFW4T+ky1xJ1
5VoHkqvM5oHO3agoGt8FhI699dNJRs7Q3AXd4fr/phHI+sEy9wVI0/5GlCNjHLzp
KMQXmc788kaOcasIwRd7sgdRhtyrDH+t4H/Pb7CTy9RhaTnsxupkS++iH24F53Rr
buhJr3zwxePrMEzfp1MU4f1c1DrTuir5zG9V5aGd2aIYUxLVupq8ffFzu8iG0FAt
BBcNvf7QId57X3oSTX4vN2BbPfodVXDRutnakn0pBoPcjOC0fmk=
=sLHZ
-----END PGP SIGNATURE-----
Hi
you can the use Logger class documented in
"https://docs.djangoproject.com/en/2.2/topics/logging/".
Basically the code is something like
import logging
log = logging.getLogger('delhisanjays_app')
log.info.('user logged in')
You can enhance the log message to your needs.
Cheers
Am 22.07.19 um 19:27 schrieb SNJY G:
> Hello Django Experts,
> There is Django application which uses LDAP in middleware for user
> authentication.
> I need to record user login and logout time. For that purpose, I think of a
> basic flow as per following details -
> Create new model for logging
> Make a function in views.py which will add the login/ logout time and date
> to a model.
> Call the function every time when user login/ logout.
> Could someone please suggest better way OR point me to good/relevant
> article around it.
--
Kurs 10 IT-Consulting www.kurs-10.de
Andreas Schosser a@kurs-10.de
Baldestraße. 14 Telefon +49 89 41615842-0
80469 München Telefax +49 89 41615842-3
0x85475B6B - 79BB 94F9 8523 0180 E2E5 7A8F 97B7 5BAB 8547 5B6B
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7f6d92a7-9ef0-66d7-f07e-51463a99ba3c%40kurs-10.de.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment