get_dictionary_value

Overview

Get a value from a dictionary based on a key. This is generally used with the Django as keyword to put this value into another variable for further manipulation.

Parameters

  • dictionarydictionary – The source dictionary
  • keystring – The key to retrieve from the source dictionaryt

Example

{% get_dictionary_value my_dictionary "b" %}  # {'a': 1, 'b': 2} => 2