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.
git-test/comments/urls.py

16 lines
469 B

This file contains ambiguous Unicode characters!

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
from . import views
# 设置应用命名空间用于URL反向解析
app_name = "comments"
# URL模式列表
urlpatterns = [
#文章评论提交接口
# 捕获整数类型article_id参数映射到CommentPostView视图
path(
'article/<int:article_id>/postcomment',
views.CommentPostView.as_view(),
name='postcomment'),# URL名称模板中可通过{% url 'comments:postcomment' article_id %}调用
]