Purpose ======= In python2 a binary field value is retrieved as a string. Example: company_id.logo = u'xyz' In python3 a binary field value is retrieved as a binary. Example: company_id.logo = b'xyz' When trying to render an image on a template, we should pass a stringified version of it. Specification ============= Pass the method to_text in the template rendering context and use it.