user visit count

76 views
Skip to first unread message

shreehari Vaasistha L

unread,
Apr 15, 2020, 3:39:32 AM4/15/20
to Django users
how can i get the number of views of an endpoint by a single user.

Omkar Parab

unread,
Apr 15, 2020, 5:40:12 AM4/15/20
to django...@googlegroups.com
Django hit count package will help you..

On Wed, Apr 15, 2020, 1:09 PM shreehari Vaasistha L <shreeh...@gmail.com> wrote:
how can i get the number of views of an endpoint by a single user.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b9e434ba-8378-45cb-a67f-b344773340b6%40googlegroups.com.

Tim Wilson

unread,
Apr 15, 2020, 8:18:36 AM4/15/20
to django...@googlegroups.com
I'm planning to use django-hitcount too, but please be aware that it's not yet compatible with Django 3.x. There's a patch that needs to be applied and a release forthcoming that should take care of it.

-Tim

-- 
Tim Wilson
President, Savvy Technology Group

shreehari Vaasistha L

unread,
Apr 15, 2020, 8:27:32 AM4/15/20
to Django users
I'm using django 3.x.
Anyother simple implementation ?
i just want to get number of times a particular user has viewed an object.

On Wednesday, April 15, 2020 at 5:48:36 PM UTC+5:30, Tim Wilson wrote:
I'm planning to use django-hitcount too, but please be aware that it's not yet compatible with Django 3.x. There's a patch that needs to be applied and a release forthcoming that should take care of it.

-Tim

On Wed, Apr 15, 2020, at 4:38 AM, Omkar Parab wrote:
Django hit count package will help you..

On Wed, Apr 15, 2020, 1:09 PM shreehari Vaasistha L <shreeh...@gmail.com> wrote:
how can i get the number of views of an endpoint by a single user.


--
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...@googlegroups.com.


--
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...@googlegroups.com.

shreehari Vaasistha L

unread,
Apr 15, 2020, 8:28:40 AM4/15/20
to Django users
Thank you!
But can there be any simple implementation as i just want to count number of times a user has viewed a post


On Wednesday, April 15, 2020 at 5:48:36 PM UTC+5:30, Tim Wilson wrote:
I'm planning to use django-hitcount too, but please be aware that it's not yet compatible with Django 3.x. There's a patch that needs to be applied and a release forthcoming that should take care of it.

-Tim

On Wed, Apr 15, 2020, at 4:38 AM, Omkar Parab wrote:
Django hit count package will help you..

On Wed, Apr 15, 2020, 1:09 PM shreehari Vaasistha L <shreeh...@gmail.com> wrote:
how can i get the number of views of an endpoint by a single user.


--
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...@googlegroups.com.


--
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...@googlegroups.com.

Motaz Hejaze

unread,
Apr 15, 2020, 9:25:37 AM4/15/20
to Django users
no standard for this , but thinking out loud with you ..

you can make a many to many model ( table ) of 3 columns , first column will be user id , second column will be object id , third column will be number of visits ( integer  initial value 0 ) ,  every time the object view is called you'll query the table for object.id if not found ( for first time , create a new row with this object.id and request.user.id and put number_of_visits column  = 1 ) , if found then filter by user.id , if found increase number in number_of_visits column by one , if filter not returning thing then create a new row with object.id and user.id and put number_of_visits column  = 1

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/36fd6a9b-e959-49ee-9183-f18c26daf1c9%40googlegroups.com.

shreehari Vaasistha L

unread,
Apr 15, 2020, 9:27:27 AM4/15/20
to Django users
cool man
i was trying exactly the same thing... if you try to get it work then post it here please.

shreehari Vaasistha L

unread,
Apr 16, 2020, 12:53:15 AM4/16/20
to Django users
Done


On Wednesday, April 15, 2020 at 6:55:37 PM UTC+5:30, Motaz Hejaze wrote:

Motaz Hejaze

unread,
Apr 16, 2020, 7:17:58 AM4/16/20
to Django users
Great

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9c1ca4ac-5b9d-4a87-811f-185f539c6de7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages