iexact performs a case insensitive equality check that is commonly used for strings. For decimal places with two decimal places, the backend of the Django database will probably keep "5.60" as a string for DecimalField , so an iexact comparison with this will work because the strings are equal. But since you want to compare numbers, not strings, you should just use the regular equality operator.
from decimal import Decimal Mdl.objects.get(speed=Decimal("5.6"))
Do not use strings, instead use the Decimal type created by Python. When retrieving model instances using Django, you will still get instances of this type, so you must also assign this type to be consistent.
source share