Login

Snippets by tamizhgeek

Snippet List

template filter to check login status

In templates sometimes you need to display some menu by checking whether the user is logged in or not. So use the above filter as shown below {% with request|check_login as logout %} {% if logout%} display something.... {% endif %} {% endwith %}

  • template
  • filters
  • custom
Read More

Pygmentify a code using template filter

The above snippet can be added as a custom filter for rendering code snippets in django templates. A simple '|render' next to any source code will do. To add css, use the following command to generate css file. pygmentize -S emacs -f html > pygments-colorful.css And link this css file to the template.

  • template
  • django
  • pygments
  • custom-filters
Read More

tamizhgeek has posted 3 snippets.