本文整理汇总了Python中flask.render_template方法的典型用法代码示例。如果您正苦于以下问题:Python flask.render_template方法的具体用法?Python flask.render_template怎么用?Python flask.render_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块flask的用法示例。
在下文中一共展示了flask.render_template方法的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: index
点赞 6
# 需要导入模块: import flask [as 别名]
# 或者: from flask import render_template [as 别名]
def index():
if not "last_format" in session:
session["last_format"] = "svg"
session.permanent = True
try:
variantDescription = str(dataHub.variant).replace("::", " ").replace("-", "–")
return render_template('index.html',
samples=list(dataHub.samples.keys()),
annotations=dataHub.annotationSets,
results_table=dataHub.getCounts(),
insertSizeDistributions=[sample.name for sample in dataHub if sample.insertSizePlot],
dotplots=dataHub.dotplots,
variantDescription=variantDescription)
except Exception as e:
logging.error("ERROR:{}".format(e))
raise
开发者ID:svviz,项目名称:svviz,代码行数:19,
示例2: show_review
点赞 6
# 需要导入模块: import flask [as 别名]
# 或者: from flask import render_template [as 别名]
def show_review(cotc_id: int):
"""查看某个教学班的评价"""
cotc_id = int(cotc_id)
review_info = CourseReview.get_review(cotc_id)
avg_rate = review_info['avg_rate']
reviews = review_info['reviews']
cotc = COTeachingClass.get_doc(cotc_id)
if not cotc:
return render_template('common/error.html', message=MSG_404)
if session.get(SESSION_CURRENT_USER, None) \
and CourseReview.get_my_review(cotc_id=cotc_id, student_id=session[SESSION_CURRENT_USER].identifier):
reviewed_by_me = True
else:
reviewed_by_me = False
return render_template('course/review.html',
cotc=cotc,
count=review_info['count'],
avg_rate=avg_rate,
reviews=reviews,
user_is_taking=is_taking(cotc),
reviewed_by_me=reviewed_by_me)
开发者ID:everyclass,项目名称:everyclass-server,代码行数:26,
示例3: main
点赞 6
# 需要导入模块: import flask [as 别名]
# 或者: from flask import render_template [as 别名]
def main():
"""用户主页"""
try:
is_student, student = entity_service.get_people_info(session[SESSION_CURRENT_USER].identifier)
if not is_student:
return "Teacher is not supported at the moment. Stay tuned!"
except Exception as e:
return handle_exception_with_error_page(e)
pending_grant_reqs = user_service.get_pending_requests(session[SESSION_CURRENT_USER].identifier)
pending_grant_names = []
for req in pending_grant_reqs:
pending_grant_names.append(entity_service.get_people_info(req.user_id)[1].name)
return render_template('user/main.html',
name=session[SESSION_CURRENT_USER].name,
student_id_encoded=session[SESSION_CURRENT_USER].identifier_encoded,
last_semester=student.semesters[-1] if student.semesters else None,
privacy_level=user_service.get_privacy_level(session[SESSION_CURRENT_USER].identifier),
pending_grant_names=pending_grant_names)
开发者ID:everyclass,项目名称:everyclass-server,代码行数:22,
示例4: make_web
点赞 6
# 需要导入模块: import flask [as 别名]
# 或者: from flask import render_template [as 别名]
def make_web(queue):