Skip to content Skip to sidebar Skip to footer

Django Admin Does Not Allow Saving Unicode Slugs

I'm trying to save a Persian slug for this model: class Category(models.Model): name = models.CharField('name', max_length=100) slug = models.SlugField('slug', unique=True)

Solution 1:

You can't. Slug fields can only contain ASCII letters, numbers, dashses and underlines.

If you must use non-ASCII chars in a slug-like field, you can use a normal CharField and add a db_index = True to it.

Post a Comment for "Django Admin Does Not Allow Saving Unicode Slugs"