def get_mapping(cls):
from pyplanet.core import Controller
mapping = dict()
# Static core components.
mapping['core.views'] = PackageLoader('pyplanet.views', 'templates')
# Add app prefixes.
for app_label, app in Controller.instance.apps.apps.items():
template_path = os.path.join(app.path, 'templates')
if os.path.exists(template_path):
mapping[app_label] = FileSystemLoader(template_path)
return mapping
评论列表
文章目录