You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
662 B

from django.urls import path, re_path
from .views import BlogListAPIView, RelatedBlogsAPIView, BlogDetailBySlugAPIView
app_name = 'blog'
urlpatterns = [
# Blog list with search and sort_by filters
path('list/', BlogListAPIView.as_view(), name='blog-list'),
# Related blogs for a specific blog ID
path('related/<int:blog_id>/', RelatedBlogsAPIView.as_view(), name='related-blogs'),
# Blog detail by slug (using regex to support different languages)
re_path(r'^detail/(?P<slug>[\w\-\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u200C\u200D]+)/$',
BlogDetailBySlugAPIView.as_view(),
name='blog-detail'),
]