I have created a small app in python with django, that contains registration and logging.I want to get the user logged in place and time in python.How to find this user current location.Thanks in advance
Asked
Active
Viewed 303 times
1 Answers
1
You can trigger a signal after a user authenticates.
For example:
from django.contrib.auth.signals import user_logged_in
log_user_info(sender, user, request, **kwargs):
ip = request.META.get('REMOTE_ADDR', None)
log_time = datetime.datetime.now()
...
Checkout the signals documentation for more info.
Hope this helps.

chirinosky
- 4,438
- 1
- 28
- 39