djangosnippets.org: Latest snippets posted by rafaelsdmhttps://djangosnippets.org/users/rafaelsdm/2012-06-07T21:07:44.380467-05:00rafaelsdmGenerate real random string
2012-06-07T21:07:44.380467-05:00rafaelsdmhttps://djangosnippets.org/snippets/2764/<p>Use this snippet to generate cryptografic-ready random strings</p>
Freely redistributableCache view by user (and anonymous)
2011-08-24T14:40:08.859250-05:00rafaelsdmhttps://djangosnippets.org/snippets/2524/<p>Use this decorator in your views to cache HttpResponse per user, so each user has his own cache, instead of a shared one as <code>from django.views.decorators.cache.cache_page</code> does.</p>
<p>Add this to use:
from somewhere import cache_per_user</p>
<p>@cache_per_user(ttl=3600, cache_post=False)
def my_view(request):
return HttpResponse("LOL %s"%(request.user))</p>
<p>All documentation inside the decorator are in brazilian …</p>
Freely redistributable