Login

Tag "context_processor"

Snippet List

Expose filtered settings to templates request context

**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
Read More

1 snippet posted so far.