/django-custom-settings

Provides a very simple tag to load settings variables from Django templates

Primary LanguagePythonMIT LicenseMIT

django-custom-settings

Provides a very simple tag to load settings variables from Django templates. If the variable doesn't exists, an empty string is returned.

https://travis-ci.org/MickaelBergem/django-custom-settings.svg?branch=master https://coveralls.io/repos/github/MickaelBergem/django-custom-settings/badge.svg?branch=master

Install

To install / update the module:

pip install django-custom-settings-templatetag -U

Usage

In your Django template, do the following :

{% load custom_settings %}
{% settings_value "CUSTOM_VAR_IN_SETTINGS" as CUSTOM_VAR %}
{% if CUSTOM_VAR %}
  var={{ CUSTOM_VAR }}
{% endif %}