Snippet List
**Warning**: I'm quite sure this is **not** a best practice, but this snippet has proven being very useful to me. Handle with care. I also wonder about the impact on performance, while I didn't notice any slowdown on a very small app of mine.
Idea is to expose project settings to template request context through a context processor, and \__doc__ should be self-explanatory.
Of course, if you know a better way to achieve the purpose, please tell in the comments.
- templates
- settings
- python
- context_processor
This is an enhancement of snippet [#172](http://djangosnippets.org/snippets/172/). Here I use [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/) — far more easier to install through pip in a virtualenv, and possibly a bit more maintained — to format and properly indent the rendered HTML from templates.
I also added a check to only tidy contents in a `DEBUG=True` environment, regarding high impact on performance while doing so in production.
Last, it's compatible with Django 1.2.x.
- templates
- format
- html
- tidy
- syntax
- output
- prettify
- formatting
- indentation
- readability
n1k0 has posted 2 snippets.