views.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:db0.company 作者: db0company 项目源码 文件源码
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)],
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号