I want to display the number of active visitors on my website, I tried using django-tracking, django-active-users but none of them worked because they are outdated. I am using Django 3.0.8 and all of those modules aren't supported with django3.
I also tried doing this with Google analytics but their real-time reporting API is in limited beta and not open to everyone. Is there any way I can get this to work using Django active sessions or something?
Create a
DailyCountmodel which hasdate(DateField),active_users(PositiveIntegerField).Then use celery periodic tasks with a function that is triggered at
hour=0, minute=0, i.e., every day.Create a
DailyCountinstance in the triggered function.Whenever a user visits the site for the first time that day, increase
DailyCount.active_usersby 1.