Search code examples
djangohebrewslug

how to Write in Django SlugField with hebrew


i need help how to write Hebrew in SlugField in django models

now i can write only English something like: hello-world but i what to write in SlugField = "שלום-עולם" and the url be like: www.somsite.com/blog/שלום-עולם

10X


Solution

  • The whole idea of the slugfield is that it converts a given string to only url-safe characters. Hebrew is unicode, which means that it generally is unsafe to use in the url. If you want to override this, just use your article title instead of a slugfield.