from django.views.debug import cleanse_setting


def cleanse_dictionary(dictionary):
    """
    Cleanse sensitive values in a dictionary.
    """

    cleansed_dictionary = {}

    for key, val in dictionary.iteritems():
        cleansed_dictionary[key] = cleanse_setting(key, val)

    return cleansed_dictionary

@@ -1,8 +1,59 @@
+from django.utils.datastructures import SortedDict%0A
 from dja
@@ -222,10 +222,20 @@
 y = 
-%7B%7D
+SortedDict()
 %0A%0A  

Use sorted dictionary in cleanse_dictionary.