selwin / django-user_agents

A django package that allows easy identification of visitor's browser, OS and device information, including whether the visitor uses a mobile phone, tablet or a touch capable device.
MIT License
640 stars 104 forks source link

Added unique identifier to cache_key in utils.py #2

Closed therealtomrose closed 11 years ago

therealtomrose commented 11 years ago

Selwin,

Love django_user_agents. It just saved me a ton of time and effort. Great usability.

I was just debugging my cache and had a heck of a time figuring out what this one entry was that didn't have a unique identifier. It turned out to be django-user_agents. I was only able to figure this out by searching for the hash itself and found out that it was a user_agent string. That's what tipped me off. Any how...

The django best practice appears to be appending a unique string to the cache_key for identification purposes. I prepended 'django_user_agents.' to the md5 you were using.

Fast, and easy :)

Happy coding,

T

selwin commented 11 years ago

@therealtomrose sorry, for some reason I missed this PR. Thanks for the patch!