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.
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.
# 赵瑞萍: 评论应用URL配置模块, 用于定义评论相关的URL路由规则
# 核心功能: 映射评论提交的URL路径到对应视图, 支持通过文章ID关联评论目标
# 赵瑞萍: 导入Django URL核心函数, 用于定义路径匹配规则
from django . urls import path
# 赵瑞萍:导入当前应用的视图模块,关联评论提交的处理逻辑
from . import views
# 赵瑞萍:定义应用命名空间"comments", 避免多应用间URL名称冲突
# 模板中引用格式:{% url 'comments:postcomment' article_id %}
app_name = " comments "
# 赵瑞萍: URL模式列表, 存储该应用的所有路由规则
urlpatterns = [
# 赵瑞萍:评论提交路由,用于处理用户发布/回复评论的请求
path (
' article/<int:article_id>/postcomment ' , # URL路径: 包含整数类型的文章ID参数( article_id)
# 关联视图类: 将CommentPostView类视图转换为可调用的视图函数
views . CommentPostView . as_view ( ) ,
name = ' postcomment ' # URL名称, 用于反向解析( 如reverse('comments:postcomment'))
) ,
]