def cautious_slugify(value):
 value = force_text(value)
 value = unicodedata.normalize(u'NFKD', value)
 value = SLUGIFY_RE.sub(u'', value)
 value = value.encode(u'ascii', u'backslashreplace').decode(u'ascii')
 return slugify(value)

def cautious_slugify ( value ) : value = force_text ( value ) value = unicodedata . normalize ( u'NFKD' , value ) value = SLUGIFY_RE . sub ( u'' , value ) value = value . encode ( u'ascii' , u'backslashreplace' ) . decode ( u'ascii' ) return slugify ( value )
convert a string to ascii exactly as djangos slugify does .