安装
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'```
本文标题:Django 中文转化成拼音的工具slug
本文链接:https://www.haomeiwen.com/subject/qwurfttx.html
网友评论