replace '%s' in string "%s; charset=%s" with settings.DEFAULT_CONTENT_TYPE and self._charset, substitute it for content_type.
content_type = "%s; charset=%s" % ( settings . DEFAULT_CONTENT_TYPE , self . _charset )