Login

Snippets by pedrolima

Snippet List

Middleware to remove the WWW from the URL

Works like the [PREPEND_WWW](http://www.djangoproject.com/documentation/settings/#prepend-www) setting but, instead of adding, it removes the www. Usage: In the settings file add the UrlMiddleware to the middleware list and set REMOVE_WWW = True

  • middleware
Read More

Boxes as template tags

It's a template tag used to create boxes with nested divs (useful to keep the templates DRY). For example: {% menubox titlevar %} Content here {% endmenubox %} will generate the html with the nested divs div class=box div class=box-outer div class=box-inner Headline Content /div /div /div [more detail on this blog post](http://pedro.valelima.com/blog/2007/sep/26/boxes-template-tags/)

  • template-tag
  • box
Read More

pedrolima has posted 3 snippets.