2

How to enable Unicode in URL slug?
 

I have Searched a lot in Askbot source code to understand how Askbot deal with URL slugs.

Why unicode url? because my Askbot site using Arabic language and all user input in Arabic, only 20% in English.

I found the solution and I'll write it as answer. However, I really can't understand why this not enabled by default?

At least it should be placed as comment in settings.py and any one can enable it by uncomment the option.

A lot of Askbot power are not documented, this what I unlike in Askbot, each time I have to do something not documented in Askbot I have to read some source code, well not everyone understand Python/Django, and it's waste of time.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Mustafa's avatar
48
Mustafa
asked 11 years ago

Comments

1

Why it's not enabled by default - browsers used to have poor support for the unicode URLs and would show gibberish in the address bar, this is getting better though and eventually it may be the default setting.

Evgeny's avatar Evgeny (11 years ago)

Ok, but why it's not placed as comment in settings.py for easy on/off :)

Mustafa's avatar Mustafa (11 years ago)
see more comments

1 Answer

3

To enable this feature, simply open settings.py and at the end of file, insert as new line

ALLOW_UNICODE_SLUGS = True

Save file, and restart web-server.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Mustafa's avatar
48
Mustafa
answered 11 years ago
link

Comments

see more comments