if DEFAULT_THEME_PATH != CUSTOM_THEME_PATH: STATICFILES_DIRS.append( ('themes/default', os.path.join(ROOT_PATH, DEFAULT_THEME_PATH)), ) STATICFILES_DIRS.append(('custom', CUSTOM_THEME), ) # Load the subdirectory 'img' of a custom theme if it exists, thereby allowing # very granular theme overrides of all dashboard img files using the first-come # first-serve filesystem loader. if os.path.exists(os.path.join(CUSTOM_THEME, 'img')): STATICFILES_DIRS.insert( 0, ('dashboard/img', os.path.join(CUSTOM_THEME, 'img'))) # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(HORIZON_CONFIG) # Load the pluggable dashboard settings import openstack_dashboard.enabled import openstack_dashboard.local.enabled from openstack_dashboard.utils import settings INSTALLED_APPS = list(INSTALLED_APPS) # Make sure it's mutable settings.update_dashboards( [ openstack_dashboard.enabled, openstack_dashboard.local.enabled, ], HORIZON_CONFIG, INSTALLED_APPS, )
theme_settings.get_theme_static_dirs( AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) if CUSTOM_THEME_PATH is not None: logging.warning("CUSTOM_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") if DEFAULT_THEME_PATH is not None: logging.warning("DEFAULT_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(HORIZON_CONFIG) # Ensure that we always have a SECRET_KEY set, even when no local_settings.py # file is present. See local_settings.py.example for full documentation on the # horizon.utils.secret_key module and its use. if not SECRET_KEY: if not LOCAL_PATH: LOCAL_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'local') from horizon.utils import secret_key SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store')) # Load the pluggable dashboard settings import openstack_dashboard.enabled
theme_settings.get_theme_static_dirs( AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) if CUSTOM_THEME_PATH is not None: logging.warning("CUSTOM_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") if DEFAULT_THEME_PATH is not None: logging.warning("DEFAULT_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(HORIZON_CONFIG, AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) # Ensure that we always have a SECRET_KEY set, even when no local_settings.py # file is present. See local_settings.py.example for full documentation on the # horizon.utils.secret_key module and its use. if not SECRET_KEY: if not LOCAL_PATH: LOCAL_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'local') from horizon.utils import secret_key SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store')) # Load the pluggable dashboard settings import openstack_dashboard.enabled
theme_settings.get_theme_static_dirs( AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) if CUSTOM_THEME_PATH is not None: logging.warning("CUSTOM_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") if DEFAULT_THEME_PATH is not None: logging.warning("DEFAULT_THEME_PATH has been deprecated. Please convert " "your settings to make use of AVAILABLE_THEMES.") # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(HORIZON_CONFIG, AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH) # Ensure that we always have a SECRET_KEY set, even when no local_settings.py # file is present. See local_settings.py.example for full documentation on the # horizon.utils.secret_key module and its use. if not SECRET_KEY: if not LOCAL_PATH: LOCAL_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'local') from horizon.utils import secret_key SECRET_KEY = secret_key.generate_or_read_from_file( os.path.join(LOCAL_PATH, '.secret_key_store')) # Load the pluggable dashboard settings import openstack_dashboard.enabled
TEMPLATE_DIRS = \ (os.path.join(CUSTOM_THEME_PATH, 'templates'),) + TEMPLATE_DIRS # Only expose the subdirectory 'static' if it exists from a custom theme, # allowing other logic to live with a theme that we might not want to expose # statically if os.path.exists(os.path.join(CUSTOM_THEME, 'static')): CUSTOM_THEME = os.path.join(CUSTOM_THEME, 'static') STATICFILES_DIRS.append( ('custom', CUSTOM_THEME), ) # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(ROOT_PATH, HORIZON_CONFIG) # Load the pluggable dashboard settings import openstack_dashboard.enabled import openstack_dashboard.local.enabled from openstack_dashboard.utils import settings INSTALLED_APPS = list(INSTALLED_APPS) # Make sure it's mutable settings.update_dashboards( [ openstack_dashboard.enabled, openstack_dashboard.local.enabled, ], HORIZON_CONFIG, INSTALLED_APPS, )
) STATICFILES_DIRS.append( ('custom', CUSTOM_THEME), ) # Load the subdirectory 'img' of a custom theme if it exists, thereby allowing # very granular theme overrides of all dashboard img files using the first-come # first-serve filesystem loader. if os.path.exists(os.path.join(CUSTOM_THEME, 'img')): STATICFILES_DIRS.insert(0, ('dashboard/img', os.path.join(CUSTOM_THEME, 'img'))) # populate HORIZON_CONFIG with auto-discovered JavaScript sources, mock files, # specs files and external templates. find_static_files(ROOT_PATH, HORIZON_CONFIG) # Load the pluggable dashboard settings import openstack_dashboard.enabled import openstack_dashboard.local.enabled from openstack_dashboard.utils import settings INSTALLED_APPS = list(INSTALLED_APPS) # Make sure it's mutable settings.update_dashboards( [ openstack_dashboard.enabled, openstack_dashboard.local.enabled, ], HORIZON_CONFIG, INSTALLED_APPS, )