How to slugify unicode string in Django

I use unidecode for ASCII transliterations of Unicode text

pip install Unidecode

Example

from unidecode import unidecode
from django.utils.text import slugify

text = 'Тест'

text = unidecode(text.decode('utf8'))
slugify(unicode(text))

# u'test'
comments powered by Disqus