def jinja2_environment(cls):
# set the template search path to pages
if not RRequest.environment:
RRequest.environment = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'pages')))
# add readable date filter to make it available for templates
RRequest.environment.filters['readable_date'] = readable_date
RRequest.environment.filters['crash_uri'] = crash_uri
RRequest.environment.filters['snippetize'] = snippetize
RRequest.environment.filters['issue_url'] = issue_url
return RRequest.environment
评论列表
文章目录