首页 > 解决方案 > 我如何在 DJANGO 中运行我的 python 程序

问题描述

我有网络抓取的 python 脚本,它从 youtube 获取给定的名字歌曲,并以 JSON 格式给我输出。它有许多字段,如 url、标题、缩略图、持续时间和艺术家,所有这些字段都存储在 JSON 文件中。所以我想在 Django views.py 中添加该脚本,那么我该如何实现它。

这是输出的图片。

标签: pythondjangoweb-scrapingdjango-rest-framework

解决方案


first use your requests then put it in context then return it after all use your current context into html file


推荐阅读