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')
评论列表
文章目录