当前位置: 首页>>代码示例>>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;未经允许,请勿转载。