Skip to content

MickaelBergem/django-custom-settings

Repository files navigation

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.

image

image

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 %}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages