The solution is extremely simple: pip install awesome-slugify # For alternate russian transliteration support SLUGIFY = 'slugify.slugify_ru' # In local_settings.py. Or slugify.slugify which is more generic
2016-01-11 8:35 GMT+03:00 Денис Борисов <[email protected]>: > I'm new in Django. Sorry for my stupid question. Now I see the right way > with help of your comments. > Big thanks! I'll post my solution soon > > 2016-01-11 6:15 GMT+03:00 Mike Dewhirst <[email protected]>: > >> On 11/01/2016 1:25 PM, [email protected] wrote: >> >>> Yes it is but it is not that i want =) >>> Sorry for my poor english. May be you did not correctly understand my >>> previous message. >>> I want to convert any unicode symbols to english ascii symbols. >>> slugify_unicode makes url with russian characters if page title is in >>> russian. It is not that i want. >>> And django's slugify simply strips non-ascii characters. It not that I >>> want too. >>> Is there any way to convert (transliterate) unicode to ascii on the fly >>> without additional programming? Any config option or something like this? >>> >> >> I haven't seen one but I'm interested so I googled and found ... >> >> >> http://stackoverflow.com/questions/816285/where-is-pythons-best-ascii-for-this-unicode-database >> >> ... which might let you get some of the transliteration done in your own >> slugify() based on Django's slugify() in django/utils/text.py. You might >> also need to maintain a list of unicode chars you don't like and replace >> them with your preferred ascii chars before using slugify. >> >> Good luck and please post your solution >> >> Thanks >> >> Mike >> >> >>> понедельник, 11 Ñ Ð½Ð²Ð°Ñ€Ñ 2016 г., 1:48:31 UTC+3 >>> пользователь Stephen McDonald Ð½Ð°Ð¿Ð¸Ñ Ð°Ð»: >>> >>> The first dozen or so results in Google when searching for >>> "slugify unicode" reveal exact what you want. >>> >>> On Mon, Jan 11, 2016 at 12:01 AM, <[email protected] <javascript:>> >>> wrote: >>> >>> Hi guys, >>> >>> I have a site with russian locale and want to convert non-ascii >>> slugs into ascii one to avoid ugly urlencoded urls. >>> I've replaced Mezzanine's slugify with Django's >>> default django.template.defaultfilters.slugify but it just >>> strips non-ascii characters but i want to transliterate them. >>> Is there any way to do it in Mezzanine without making own >>> slugify? >>> >>> Thnx for any answer. >>> >>> -- >>> You received this message because you are subscribed to the >>> Google Groups "Mezzanine Users" group. >>> To unsubscribe from this group and stop receiving emails from >>> it, send an email to [email protected] >>> <javascript:>. >>> For more options, visit https://groups.google.com/d/optout >>> <https://groups.google.com/d/optout>. >>> >>> >>> >>> >>> -- >>> Stephen McDonald >>> http://jupo.org >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Mezzanine Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] >>> <mailto:[email protected]>. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Mezzanine Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
