當前位置: 首頁>>代碼示例>>Python>>正文


Python current_app.send_static_file方法代碼示例

本文整理匯總了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")) 
開發者ID:jddunn,項目名稱:emoter,代碼行數:20,代碼來源:run_emote.py

示例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') 
開發者ID:HaoZhang95,項目名稱:Python24,代碼行數:5,代碼來源:views.py

示例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') 
開發者ID:jddunn,項目名稱:emoter,代碼行數:4,代碼來源:run_emoter.py

示例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 
開發者ID:jddunn,項目名稱:emoter,代碼行數:12,代碼來源:run_emote.py

示例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) 
開發者ID:jddunn,項目名稱:emoter,代碼行數:4,代碼來源:run_emote.py

示例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') 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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') 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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') 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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') 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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') 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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)) 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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)) 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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)) 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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)) 
開發者ID:lyft,項目名稱:confidant,代碼行數:4,代碼來源:static_files.py

示例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) 
開發者ID:nasa,項目名稱:apod-api,代碼行數:5,代碼來源:application.py


注:本文中的flask.current_app.send_static_file方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。