I want slug urls. There are Cyrillic chars in urls: https://все-субсидии/раздел/НКО
I handle it:
# -*- coding: utf-8 -*-
from django.urls import path
from django.utils.http import urlquote
from django.utils.encoding import uri_to_iri
from . import views
urlpatterns = [
path('', views.index),
path('edit_article/<int:id>', views.edit_article),
path('add_article/', views.add_article),
path('article_list/', views.article_list),
path(urlquote(u'субсидия') + '/<str:category_name>/<str:name>/', views.article),
path(urlquote(u'раздел') + '/<str:section_name>/', views.category),
]
urlquote(u'раздел') = '%d1%80%d0%b0%d0%b7%d0%b4%d0%b5%d0%b'
When I write the full link(https://все-субсидии/раздел/НКО) on safari, my error is
Page not Found The current path, %25d1%2580%25d0%25b0%25d0%25b7%25d0%25b4%25d0%25b5%25d0%25bb/%25d0%259d%25d0%259a%25d0%259e/, didn't match any of these.
but when I write a (https://все-субсидии/раздел/) my error is:
Page not found(404) The current path, %d1%80%d0%b0%d0%b7%d0%b4%d0%b5%d0%bb, didn't match any of these.
in first, each % convert to %25.
Is my urls.py right?
thanks!