The horizon.themes
ModuleΒΆ
Allows Dynamic Theme Loading.
-
class
horizon.themes.
ThemeMiddleware
[source] Bases:
object
The Theme Middleware component. The custom template loaders don’t have access to the request object, so we need to store the Cookie’s theme value for use later in the Django chain.
-
process_request
(request)[source]
-
process_response
(request, response)[source]
-
-
class
horizon.themes.
ThemeTemplateLoader
(engine)[source] Bases:
django.template.loaders.base.Loader
Themes can contain template overrides, so we need to check the theme directory first, before loading any of the standard templates.
-
get_template_sources
(template_name)[source]
-
is_usable
= True
-
load_template_source
(template_name, template_dirs=None)[source]
-
-
horizon.themes.
find_theme
(theme_name)[source]
-
horizon.themes.
get_default_theme
()[source]
-
horizon.themes.
get_theme_cookie_name
()[source]
-
horizon.themes.
get_theme_dir
()[source]
-
horizon.themes.
get_themes
()[source]
-
horizon.themes.
offline_context
()[source]