完成wordpress到django站点的数据迁移,下一届阶段完成前端样式的轻度编写

This commit is contained in:
2026-10-20 02:55:22 +08:00
parent 9592e6a150
commit 16a75807ee
30 changed files with 27989 additions and 51 deletions
+23
View File
@@ -0,0 +1,23 @@
"""
博客 app 的路由配置
把 URL 路径映射到视图函数
"""
from django.urls import path
from . import views
# app_name 用于反向解析 URL
# 模板里用 {% url 'blog:post_list' %} 就会找到这里
app_name = 'blog'
urlpatterns = [
# 文章列表页
# URL: /
# name='post_list' 是反向解析的名字
path('', views.post_list, name='post_list'),
# 文章详情页
# URL: /<slug>/
# <slug:slug> 表示这部分是 slug 类型,传给 views.post_detail 的 slug 参数
path('<slug:slug>/', views.post_detail, name='post_detail'),
]