I am implementing a Django powered website in which I need to track the websites visited by a logged in user.I had googled it but didn't find anything specific to Django.
I know there is a documentation available at link
Can anyone please recommend some django specific document or some algorithm which is independent of the web browsers.
Thanks .
Edit: The django application would be acting like a portal which will authenticate users to use internet.The search will not be on the django powered website as it would just act as a portal for login,logout.
That depends on various things and you will probably get very different answers.
One way would be to store a list of urls in request.session
as a session cookie value.
If you need more persistence, you could create your own model for it and save it on each request. Something like:
class Tracker(models.Model):
url = models.URLField()
user = models.ForeignKey('auth.User')
time = models.DateTimeField(auto_now_add=True)
However this can be relatively slow depending how intense you plan to use it.
If you need to store much of this kind of data, it might be worth it to investigate adding a database backend like influxdb
which is designed to store a lot of time series data for later statistical evaluation.