runserver.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:anxiety 作者: hectron 项目源码 文件源码
def server_static(filepath):
    """Serves static assets from the directory `equitas/static`.

    This supports returning static files from subdirectories within that
    directory. For example, it allows you to return css stylesheets or even
    javascript files from those directories. For example, in your HTML, you can
    have the following:

        <script src="/static/scripts/something/something_else.js"></script>

    And this would return the script within
    `equitas/static/scripts/something/something_else`.
    """
    this_directory = os.path.dirname(os.path.abspath(__file__))
    static_directory = os.path.join(this_directory, 'anxiety', 'static')

    return static_file(filepath, root=static_directory)


################################################################################
# API for JSON requests
################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号