djangosnippets.org: Latest snippets posted by pedrolimahttps://djangosnippets.org/users/pedrolima/2008-03-21T17:52:31.288180-05:00pedrolimaMiddleware to remove the WWW from the URL
2008-03-21T17:52:31.288180-05:00pedrolimahttps://djangosnippets.org/snippets/653/<p>Works like the <a href="http://www.djangoproject.com/documentation/settings/#prepend-www">PREPEND_WWW</a> setting but, instead of adding, it removes the www.</p>
<p>Usage:
In the settings file add the UrlMiddleware to the middleware list and set REMOVE_WWW = True</p>
Freely redistributableBoxes as template tags
2008-02-20T06:54:13.874145-06:00pedrolimahttps://djangosnippets.org/snippets/607/<p>It's a template tag used to create boxes with nested divs (useful to keep the templates DRY). For example: </p>
<p>{% menubox titlevar %}
Content here
{% endmenubox %}</p>
<p>will generate the html with the nested divs</p>
<p>div class=box
div class=box-outer
div class=box-inner
Headline
Content
/div
/div
/div</p>
<p><a href="http://pedro.valelima.com/blog/2007/sep/26/boxes-template-tags/">more detail on …</a></p>
Freely redistributableManagement command to compact javascript files
2008-01-23T06:54:49.904397-06:00pedrolimahttps://djangosnippets.org/snippets/561/<p>Uses jsmin or jspacker to compact javascript files (usage example in <a href="http://pedro.valelima.com/blog/2008/jan/17/deploying-compacted-javascript-django/">this blog post</a>)</p>
Freely redistributable