app.py 文件源码

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

项目:BlogSpider 作者: hack4code 项目源码 文件源码
def show_article(aid):
    from model import get_article
    import os

    a = get_article(aid)

    def get_css(dom):
        path = '{}/css/{}.css'.format(app.static_folder,
                                      dom)
        return '{}.css'.format(dom) if os.path.isfile(path) else None

    if a is not None:
        return render_template('article.html',
                               article=a,
                               dom_css=get_css(a.domain))
    else:
        raise NotFound('article not existed')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号