本文整理汇总了Python中flask.current_app.send_static_file方法的典型用法代码示例。如果您正苦于以下问题:Python current_app.send_static_file方法的具体用法?Python current_app.send_static_file怎么用?Python current_app.send_static_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask.current_app
的用法示例。
在下文中一共展示了current_app.send_static_file方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upload_file
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def upload_file():
if request.method == 'POST':
# check if the post request has the file part
if 'file' not in request.files:
flash('No file part')
return current_app.send_static_file('templates/emote-home.html')
file = request.files['file']
# if user does not select file, browser also
# submit a empty part without filename
if file.filename == '':
flash('No selected file')
return redirect(request.url)
if file and allowed_file(file.filename):
filename = secure_filename(file.filename)
file.save(filename)
em.analyzeCSV(filename)
return redirect(url_for('static',
filename="results.csv"))
示例2: favicon
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def favicon():
# 访问网站图标,send_static_file 是flask系统访问静态文件所调用的方法
return current_app.send_static_file('news/favicon.ico')
示例3: home
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def home():
return current_app.send_static_file('templates/emoter-home.html')
示例4: home
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def home():
global firstTime
if firstTime:
firstTime = False
# Runs Emote for the first time to load the initial pickled data (first time analysis is always slower)
em.getInput("")
return current_app.send_static_file('templates/emote-home.html')
# Upload CSV for Emote mass analysis
示例5: static_file
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def static_file(path):
return app.send_static_file(path)
示例6: index
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def index():
return current_app.send_static_file('index.html')
示例7: goodbye
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def goodbye():
return current_app.send_static_file('goodbye.html')
示例8: favicon
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def favicon():
return current_app.send_static_file('favicon.ico')
示例9: not_found
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def not_found():
return current_app.send_static_file('404.html')
示例10: robots
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def robots():
return current_app.send_static_file('robots.txt')
示例11: modules
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def modules(path):
return current_app.send_static_file(os.path.join('modules', path))
示例12: static_proxy
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def static_proxy(path):
return current_app.send_static_file(os.path.join('styles', path))
示例13: scripts
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def scripts(path):
return current_app.send_static_file(os.path.join('scripts', path))
示例14: fonts
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def fonts(path):
return current_app.send_static_file(os.path.join('fonts', path))
示例15: serve_static
# 需要导入模块: from flask import current_app [as 别名]
# 或者: from flask.current_app import send_static_file [as 别名]
def serve_static(asset_path):
print(asset_path)
return current_app.send_static_file(asset_path)