Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created July 21, 2011 19:48
Show Gist options
  • Save qoelet/1098036 to your computer and use it in GitHub Desktop.
Save qoelet/1098036 to your computer and use it in GitHub Desktop.
# if we didn't get cache key, we continue with the view and then cache it before returning
resp = render_to_response(template_name, {
# ... stuff here
}, context_instance=RequestContext(request))
cache.set(vkey, resp, TIMEOUT)
return resp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment