Django-phased v.0.5.0

Advertisement
Advertisement

This technique has been desribed by Adrian Holovaty in this blog post and previously by Honza Kral. The idea is to first render the template with certain blocks denoted as "phased," such that they will not be rendered, and will remain valid template code that can be rendered with a second pass.The second pass fetches the partially-rendered template from the cache and performs a second render on it, using RequestContext to provide user-specific context to the template. This enables very fast generation of pages that have user-specific content, by bypassing the need to use the CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting.This implementation uses a secret delimiter that makes it safe against the possibility of template code injection vulnerabilities, as it only passes any given text through the template parser once. The phased blocks can also contain cached context.django-phased contains a templatetag, phased, which defines blocks that are to be parsed during the second phase. A middleware class, PhasedRenderMiddleware, processes the response to render the parts that were skipped during the first rendering.A special subclass of UpdateCacheMiddleware that drops the "Vary: Cookie" header from response when it updates the cache is also included, which, if used in place of the standard UpdateCacheMiddleware will prevent the cache middleware from varying the cache key based on cookies, thus enabling caching of pages in authenticated sessions.md5=6450ac79215160a4a43bb476f73afe39

This technique has been desribed by Adrian ... A simple two-phase template rendering application useful for caching of authenticated requests.

 
  • Django-phased
  • 0.5.0
  • Cody Soyland
  • Linux
  • Freeware
  • 10 Kb
  • 206
  • Free
 
 

Review Django-phased

  • captcha
 

Other software of Cody Soyland
    
    New Misc software
    • NetSpot  v.2.11.967NetSpot 2 is the only professional app for wireless site survey, Wi-Fi analysis and troubleshooting on Mac OS X. It's FREE and very simple, no need to be a network expert to start using NetSpot today!
    • NetLimiter  v.4.0.53NetLimiter gives you full network control over your computer. You will decide where your applications are allowed to connect and how fast these connections should be.
    • NetSpot for Windows  v.2.11.705.0NetSpot is an application for Windows 7/8/10 that is used for wireless analysis, troubleshooting and wireless site survey.
    • NetSpot - WiFi Analyzer  v.1.1.21NetSpot for Android is the best way to discover WiFi networks around you, see the network name, band, channel, signal level, security, etc. Compare, filter and analyze WiFi networks, using the obtained data to resolve possible issues with WiFi.
    • Lizard-ui  v.3.7Basic user interface for lizard websites ...
    • Lizard-map  v.3.5.2Basic map setup for lizard web sites ...