Note that there are some explanatory texts on larger screens.

plurals
  1. POSpam proof hit counter in Django
    primarykey
    data
    text
    <p>I already looked at the most popular Django hit counter solutions and none of them seem to solve the issue of spamming the refresh button.</p> <p>Do I really have to log the IP of <strong>every visitor</strong> to keep them from artificially boosting page view counts by <em>spamming the refresh button</em> (or writing a quick and dirty script to do it for them)?</p> <h2>More information</h2> <p>So right now you can inflate your view count with the following few lines of Python code. Which is so little that you don't really need to write a script, you could just type it into an interactive session:</p> <pre><code>from urllib import urlopen num_of_times_to_hit_page = 100 url_of_the_page = "http://example.com" for x in range(num_of_times_to_hit_page): urlopen(url_of_the_page) </code></pre> <h2>Solution I'll probably use</h2> <p><del>To me, it's a pretty rough situation when you need to do a bunch of writes to the database on EVERY page view, but I guess it can't be helped. I'm going to implement IP logging due to several users artificially inflating their view count. It's not that they're bad people or even bad users.</del></p> <p><strong>See the answer about solving the problem with caching... I'm going to pursue that route first. Will update with results.</strong></p> <p>For what it's worth, it seems Stack Overflow is using cookies (I can't increment my own view count, but it increased when I visited the site in another browser.)</p> <p>I think that the benefit is just too much, and this sort of 'cheating' is just too easy right now.</p> <p>Thanks for the help everyone!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload