def get_global_context(request):
"""
Get the set of variables that are needed by default across views.
"""
platform_name = get_configuration_value("PLATFORM_NAME", settings.PLATFORM_NAME)
return {
'LMS_SEGMENT_KEY': settings.LMS_SEGMENT_KEY,
'LANGUAGE_CODE': get_language_from_request(request),
'tagline': get_configuration_value(
"ENTERPRISE_TAGLINE",
getattr(settings, "ENTERPRISE_TAGLINE", '') # Remove the `getattr` when setting is upstreamed.
),
'platform_description': get_configuration_value(
"PLATFORM_DESCRIPTION",
getattr(settings, "PLATFORM_DESCRIPTION", '') # Remove `getattr` when variable is upstreamed.
),
'LMS_ROOT_URL': settings.LMS_ROOT_URL,
'platform_name': platform_name,
'header_logo_alt_text': _('{platform_name} home page').format(platform_name=platform_name),
}
评论列表
文章目录