The expected type for the settings DOCUMENT_IMAGE_MAX_SIZE is an integer. By not using django configurations IntegerValue, the value is used as it and most of the time will be a string. We must use the IntegerValue in order to cast the value in string.