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
# 导入当前应用(comments)的views模块,用于关联视图函数/类
from . import views
# 定义当前应用的命名空间为"comments",避免URL名称冲突
app_name = "comments"
# 定义URL路由列表,存储URL规则与视图的映射关系
urlpatterns = [
# 定义评论提交的URL规则
path(
'article/<int:article_id>/postcomment', # URL路径:包含文章ID(整数类型)的动态路径
views.CommentPostView.as_view(), # 关联的视图类:调用CommentPostView的as_view()方法生成视图函数
name='postcomment'), # 给该URL命名为"postcomment",用于反向解析
]