python - 我如何在 DJANGO 中运行我的 python 程序
问题描述
我有网络抓取的 python 脚本,它从 youtube 获取给定的名字歌曲,并以 JSON 格式给我输出。它有许多字段,如 url、标题、缩略图、持续时间和艺术家,所有这些字段都存储在 JSON 文件中。所以我想在 Django views.py 中添加该脚本,那么我该如何实现它。
解决方案
first use your requests then put it in context then return it after all use your current context into html file
推荐阅读
- php - 关联键上的多对一关联不起作用
- mysql - StreamSets CDC 来源:Mysql-Binarylog 无法获取驱动程序实例
- c# - 在 Unity 中移动 LineRenderer 及其父级
- python - 使用 Python 从 csv 文件创建星型模式
- java - Vaadin 10/Flow 主题与 Lumo
- sql - 将varchar转换为日期sqlserver
- ios - 如何检查按钮上的点击?迅速
- python - Python 2 中 abc.Sequence 的等价物
- linux - 我可以将 DLL 项目编译为 ARM 的共享对象 (.so) 文件吗?
- amqp - amqp_consume_message 如何表示意外帧