我使用django livesettings将站点标题保存到数据库中。但是,要访问配置值,需要通过视图将变量传递给模板:
http://django-livesettings.readthedocs.org/en/latest/usage.html#accessing-your-value-in-a-view
什么方法管理模型管理员类是否可以重写以将变量传递到基_网站.html,管理站点标题“Django site admin”位于何处?在
这个答案可能很接近,但我不知道它遗漏了什么: Django how to pass custom variables to context to use in custom admin template?
第二个链接是关于将额外变量添加到
}本身
ModelAdmin
的changelist页面。base_site.html
由许多管理页和视图扩展,如果您想要一些全局更改,您需要扩展所有相关视图的上下文,或者通过setting a variable in the context覆盖{相关问题 更多 >
编程相关推荐