djangosnippets.org: Latest snippets posted by arusenihttps://djangosnippets.org/users/aruseni/2014-11-09T19:01:02.590401-06:00aruseniPreviewing Django templates in a browser, without even creating a Django project
2014-11-09T19:01:02.590401-06:00arusenihttps://djangosnippets.org/snippets/10421/<p><strong>preview_template.py</strong> allows you to test a Django template located in the current working directory (first argument). The template is rendered with the given context (second argument, <em>optional</em>), and the result is immediately piped into the browser with the <a href="http://rtomayko.github.io/bcat/">bcat</a> utility.</p>
<p><strong>Usage:</strong></p>
<pre><code>python preview_template.py [template name] [context]
</code></pre>
<p><strong>Example:</strong></p>
<pre><code>python preview_template.py …</code></pre>
Freely redistributableFilter change list by a date range
2012-02-05T23:50:34.056189-06:00arusenihttps://djangosnippets.org/snippets/2675/<p>The Django admin site has a feature to filter objects in change list by parameters supplied in the query string. Particularly, parameters such as date__gte and date__lte can be used.</p>
<p>This example is for filtering objects in change list by a date range (the date field is called expiration_date, but …</p>
Freely redistributable