Django实现文章详情页面跳转代码实例
作者:frantzz 时间:2023-08-29 05:41:47
1.由于不支持博客首页到文章详情页的跳转,只能打开第一篇文章的详情页
2.所以需要做以下工作:
设计文章详情页的url,完善视图函数逻辑,实现首页跳转
/blog/detail =>不能指定某一篇文章
/blog/detail/1 => 博客唯一id唯1的文章
/blog/detail/2 => 博客唯一id唯2的文章
/blog/detail/3 => 博客唯一id唯3的文章
/blog/detail/......
获取URL路径参数:<>
页面跳转:href指定html
3.
4.view.py
5.路由
以上。
来源:https://www.cnblogs.com/frantz/p/11546310.html
标签:Django,文章,页面,跳转
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python 如何用terminal输入参数
2023-02-19 08:06:15
python+excel接口自动化获取token并作为请求参数进行传参操作
2022-05-19 04:10:18
![](https://img.aspxhome.com/file/2023/0/96970_0s.jpg)
TensorFlow在MAC环境下的安装及环境搭建
2023-09-14 10:32:23
![](https://img.aspxhome.com/file/2023/0/125130_0s.png)
了解WEB页面工具语言XML(五)好处
2008-09-05 17:19:00
Python中csv模块的基本使用教程
2021-06-20 21:49:55
![](https://img.aspxhome.com/file/2023/2/92232_0s.jpg)
Python matplotlib画曲线例题解析
2022-10-18 14:17:30
![](https://img.aspxhome.com/file/2023/4/86324_0s.png)
解决python super()调用多重继承函数的问题
2022-09-28 07:50:44
python实现windows下文件备份脚本
2021-05-06 06:32:41
Golang数据类型比较详解
2023-07-17 10:11:21
![](https://img.aspxhome.com/file/2023/5/93665_0s.jpg)
python 定时器,轮询定时器的实例
2023-07-08 04:26:57
详解python使用金山词霸的翻译功能(调试工具断点的使用)
2021-06-27 03:33:52
![](https://img.aspxhome.com/file/2023/7/111907_0s.png)
Pytorch用Tensorboard来观察数据
2022-11-28 19:57:52
![](https://img.aspxhome.com/file/2023/0/68410_0s.png)
Python socket 套接字实现通信详解
2023-05-16 04:18:08
JS异步宏队列微队列原理详解
2024-04-22 13:26:43
![](https://img.aspxhome.com/file/2023/6/135686_0s.jpg)
mysql向mariadb平滑过渡的步骤详解
2024-01-26 18:12:39
pyinstaller打包python3.6和PyQt5中各种错误的解决方案汇总
2021-01-13 18:58:48
pytorch实践线性模型3d详解
2023-04-01 22:58:29
![](https://img.aspxhome.com/file/2023/7/115177_0s.png)
自己用python做的一款超炫酷音乐播放器
2021-05-26 04:47:35
![](https://img.aspxhome.com/file/2023/2/121502_0s.gif)
SQL Server中的XML数据类型详解
2024-01-15 20:56:44
![](https://img.aspxhome.com/file/2023/5/113555_0s.png)
设计角色的分工和配合
2008-10-20 12:08:00
![](https://img.aspxhome.com/file/UploadPic/200810/20/2008102012945335s.jpg)