安装
pip install django-uuslug
载入模块
In [1]: from uuslug import slugify
In [2]: txt = "This is a test"
In [3]: slugify(txt)
Out[3]: u'this-is-a-test'
In [4]: txt = "这是一个测试"
In [5]: slugify(txt)
Out[5]: u'zhe-shi-yi-ge-ce-shi'```
pip install django-uuslug
In [1]: from uuslug import slugify
In [2]: txt = "This is a test"
In [3]: slugify(txt)
Out[3]: u'this-is-a-test'
In [4]: txt = "这是一个测试"
In [5]: slugify(txt)
Out[5]: u'zhe-shi-yi-ge-ce-shi'```