当前位置:网站首页>flask 静态文件服务搭建
flask 静态文件服务搭建
2022-07-28 18:43:00 【骑单车的王小二】
from flask import Flask, request,render_template,url_for,redirect,send_file
import http.client
import json
import process
#创建Flask对象app并初始化, 设置项目的根目录作为静态文件的文件夹。你可以根据具体使用改变
app = Flask(__name__, static_url_path='')
@app.route('/')
@app.route('/data/a.txt')
def root():
path = '/data/' #指定路径
return send_file('a.txt',path)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8182, debug=True)
边栏推荐
- LeetCode_位运算_中等_260.只出现一次的数字 III
- Linxu 【权限,粘滞位】
- LVS deployment Dr cluster
- "When you are no longer a programmer, many things will get out of control" -- talk to SUSE CTO, the world's largest independent open source company
- 动态规划:背包问题模板代码汇总
- TCP.IP
- 根据openGauss/MogDB的lwtid查看线程堆栈。
- Explain RESNET residual network in detail
- 产品力大幅提升 新款福特探险者发布
- 太空射击第09课:精灵动画
猜你喜欢

Music says

【服务器数据恢复】HP StorageWorks系列存储RAID5两块盘故障离线的数据恢复案例

Use of DDR3 (axi4) in Xilinx vivado (5) board test

Residual network RESNET source code analysis - pytoch version

Product manager interview | innovation and background of the fifth generation verification code

js图表散点图例子

C language data 3 (1)

LVS load balancing cluster

Linxu 【权限,粘滞位】
![[POC - proof of concept]](/img/57/0916e3711b27e2debfbdb9c9cb9713.png)
[POC - proof of concept]
随机推荐
Representation of base and number 2
想画一张版权属于你的图吗?AI作画,你也可以
Tree row expression
MySQL error: specified key was too long; max key length is 767 bytes
一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力
[pytorch] LSTM neural network
Unity gadget displays the file size of the resource directory
Read JSON configuration file to realize data-driven testing
Solve the problem that jupyter cannot import new packages
上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展
How bad can a programmer be? Nima, they are all talents
Commands related to obtaining administrator permissions
C# 读取 CSV文件内数据,导入DataTable后显示
Explain several mobile ways of unity in detail
Raspberry pie 4B deploy yolov5 Lite using ncnn
GRU神经网络
Mysql报错:Specified key was too long; max key length is 767 bytes
LVM logical volume
Product manager interview | innovation and background of the fifth generation verification code
微信公众号授权登录后报redirect_uri参数错误的问题