本文整理匯總了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)