Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

django_custom_settings_templatetag-1.1.0-py2.py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page