Hi, I want to create a website visitors counter where it shows on the website how many users visits the website. Please help
do you want to use third party library or interested to create your own logic to handle it?
- scott 4 years, 10 months agoI want to create using own logic. Not interested on using third party
- janice10sombillo 4 years, 10 months agoIn that case, you can start exploring of creating your own mixins using ContentType
- scott 4 years, 10 months agoJust an example, you can create model to store the user viewed object details in that model, step 2 create the MIXIN and step 3 . add the mixin to your detailed view. For example, you can create the models like this using *ContentType *
class ObjectViewed(models.Model):
user = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL)
content_type = models.ForeignKey(ContentType, blank=True, null=True, on_delete=models.SET_NULL)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
timestamp = models.DateTimeField(auto_now_add=True)
Im just new to django can you you show some sample or demo please ive been finding a solution for almost a week. Thanks
- janice10sombillo 4 years, 10 months agoi have already shared the example of how to create it.i would suggest try from your end as you are new to Django. This is not beginner topic. So try from your end using example which i sent. If you still stuck , let me know , i will setup a meeting with you.
- scott 4 years, 10 months agoI'm still stuck. Is there a tutorial on how can I make visitors counter? sorry im so confused
- janice10sombillo 4 years, 10 months agoeven if we show you demo also it will be hard , because this is little advance concept. Thats why we suggest you to get the better understanding of BASIC and start implement this.
- VengatAs we didnt get any update on this. We are closing the ticket from our end.
- Vengat
Acknowledged