def globalContext(request, nav=NAV):
rainbow = utils.getRainbowFromSize(len(nav))
return {
'current': resolve(request.path_info).url_name,
'static_url': (settings.STATIC_FULL_URL + settings.STATIC_URL).replace('//static', '/static'),
'site_name': 'db0.company',
'site_description': 'Deby Lepage Official Website',
'debug': settings.DEBUG,
'static_files_version': '2',
'rainbow': [(
(index * (100/len(RAINBOW))),
((index + 1) * (100 / (len(RAINBOW)))),
color,
) for index, color in enumerate(RAINBOW)],
'nav': [tuple(list(info) + [rainbow[index]]) for index, info in enumerate(nav)],
}
评论列表
文章目录