This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
from django.urls import path # 导入Django的路径函数,用于定义URL路由
from . import views # 从当前应用导入视图模块
app_name = "comments" # 定义应用的命名空间,用于模板中URL反向解析
urlpatterns = [ # URL模式列表,定义URL与视图的映射关系
path(
'article/<int:article_id>/postcomment', # URL路径,包含文章ID参数(整数类型)
views.CommentPostView.as_view(), # 关联的视图类,使用as_view()方法转换为可调用视图
name='postcomment' # 该URL的名称,用于反向解析
),
]