nl: call the method DjangoSafeDumper.add_representer with arguments decimal.Decimal and DjangoSafeDumper.represent_decimal.
code: DjangoSafeDumper . add_representer ( decimal . Decimal , DjangoSafeDumper . represent_decimal )