How to pass UNICODE characters in a url?

I am attempting my first steps in web dev with Django. Can anybody help me modify somehow the paths so that <slug:slug> works for Unicode characters, not only ASCII?

from django.urls import path
from . import views

urlpatterns = [
    path('book/<slug:slug>/', views.view_book, name='book'),
    path('genres/', views.view_all_genres, name='genres'),
    path('genres/<slug:slug>/', views.preview_genre, name='preview_genre'),
]

I tried to play around with some regex but still I couldn't solve my problem

Вернуться на верх