Login

Snippets by pflanno

Snippet List

tag to store a settings value as template variable

Get any value from settings.py as a template variable. The variable can then be used in conditional tags. E.g. to show a link to a help page only if it the help page url is defined in settings.py {% load get_setting %} {% get_setting MY_HELP_URL as help_url %} {% if help_url %}<a href="{% help_url|safe %}">Help</a>{% endif %}

  • template
  • tag
  • templatetag
  • settings
Read More

pflanno has posted 1 snippet.