I have a website programmed in Django, and as part of the website, I have a view counter for individual pages. However, since I test-view my own files rather often, I don't want to count views that I give to my own pages.
Right now, all I do is that when a specific page is requested, it simply updates a "views" variable in the model for that page by increasing it by 1. This is okay for my own purposes - I don't mind recording multiple views by the same person - but I simply don't want my own views to count.
What ways are there to do this? Please advise.
You can set a temporary cookie variable in your browser.
For example, in Chrome, you can use the following or the
Resources
tab on the Web Inspector:javascript:document.cookie="my_app_who_am_i=itsa_me_mario"
and pull it back using some django:
Or if you had sessions setup already on your web server, you could set the cookie only when your account logs in.