my opinion, frontend: setup a ping api, and refresh every 30 seconds, pass in a current page url from javascript, and return current page viewers.
backup: a table has 3 main column (user id, page id, last_ping). update the page_id and last_ping when receiving a ping request. and return users list who are on the same page and last_ping within 60 seconds. 30 or 60 seconds are sample data. Regards, Dig 2014-3-4 下午8:30于 "Some Developer" <someukdevelo...@gmail.com>写道: > Hopefully someone here will be able to point me in the right direction. > > Basically I want to be able to view which users are viewing a page at any > given time and I want to be able to update it in real time using JavaScript > but I'm at a loss as to how to track which users are viewing any given page > in Django. > > So for instance if I had mydomain.com/page/ I'd like a little box on the > top of the page saying "Page being viewed by users: xxx and yyy" and then > when one of those users navigates away from the page the box updates to > remove that user from the list. > > I'm not sure if I have described what I want clearly enough so if you need > any more information let me know. Any help is appreciated :). > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-users/5315C6F8.10701%40googlemail.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAObE2pED60iprTzivr--LQv_yVPcverJurnJ8EPE9MEpXOq1MQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.