当前位置:网站首页>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)
边栏推荐
- Database tuning - connection pool optimization
- Unity performance optimization scheme arrangement
- Redis入门一:Redis实战读书笔记
- 卡通js射击小游戏源码
- 【pytorch】LSTM神经网络
- [POC - proof of concept]
- Redis review summary
- 7/27 训练日志(位运算+后缀数组)
- Unity makes prefabricated bodies with one key and modifies prefabricated bodies with one key
- Does any elder brother know how to solve the huge flinksql log
猜你喜欢

卡通js射击小游戏源码

The product power is greatly improved, and the new Ford Explorer is released

企业如何成功完成云迁移?
关于链接到其他页面的标题

Unity object path query tool

JS win7 transparent desktop switching background start menu JS special effect

Voice controlled robot based on ROS (II): implementation of upper computer
![[C语言刷题篇]链表运用讲解](/img/44/1de4e3f0712780680fbdc904dfe39a.png)
[C语言刷题篇]链表运用讲解

Introduction to redis II: RedHat 6.5 installation and use

如何平衡SQL中的安全与性能?
随机推荐
CNN convolution neural network learning process (weight update)
Unity makes prefabricated bodies with one key and modifies prefabricated bodies with one key
h5微信射击小游戏源码
About the title of linking to other pages
DOS common commands
Unity package exe to read and write excel table files
Mysql报错:Specified key was too long; max key length is 767 bytes
Anaconda creation environment
Residual network RESNET source code analysis - pytoch version
Networkx common operations summary (for personal use)
同质化代币与 NFT 结合,如何使治理结构设计更灵活?
太空射击第13课: 爆炸效果
Nocturnal simulator settings agent cannot be saved
PL515 SOT23-5 单/双口 USB 充电协议端口控制器 百盛电子代理商
Clock distribution of jesd204 IP core (ultrascale Series)
Redis的三种删除策略以及逐出算法
Speech controlled robot based on ROS (I): realization of basic functions
Introduction to redis II: RedHat 6.5 installation and use
Linxu 【基本指令】
太空射击第09课:精灵动画