djangosnippets.org: Latest snippets tagged with 'closure'https://djangosnippets.org/tags/closure/2009-11-06T03:09:07.307181-06:00Google Closure support in django-compress
2009-11-06T03:09:07.307181-06:00fabrice.bonnyhttps://djangosnippets.org/snippets/1785/<p>A filter to integrate Google Closure compiler in django-compress plugin.
</p>
<ol>
<li>
<a href="http://code.google.com/p/django-compress/">download django-compress</a>
</li>
<li>
install it
</li>
<li>
<a href="http://code.google.com/closure/compiler">download Closure Compiler</a>
</li>
<li>
put the jar at the root of your project
</li>
<li>
put this snippet as a <strong><strong>init</strong>.py</strong> file in a <strong>google_closure</strong> directory in the filters directory of the plugin
</li>
<li>
add <code>COMPRESS_JS_FILTERS = ('compress.filters.google_closure.GoogleClosureCompilerFilter',)</code> to …</li></ol>
Freely redistributablelimit view request rate decorator
2009-05-25T13:07:24.783175-05:00anatoliy.larinhttps://djangosnippets.org/snippets/1524/<p>Limit rate request decorator for view.</p>
<p>Authenificated user can't request decorated view often then timeout.</p>
<p>Usage:</p>
<pre><code>@limit_request_rate(time_beetween_request_sec)
def my_view(request):
...
</code></pre>
<p>get_cell_value from <a href="http://code.activestate.com/recipes/439096/">here</a></p>
Freely redistributable