示例#1
0
    MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media'))

if MEDIA_URL is None:
    MEDIA_URL = WEBROOT + 'media/'

if STATIC_ROOT is None:
    STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static'))

if STATIC_URL is None:
    STATIC_URL = WEBROOT + 'static/'

AVAILABLE_THEMES, SELECTABLE_THEMES, DEFAULT_THEME = (
    theme_settings.get_available_themes(
        AVAILABLE_THEMES,
        CUSTOM_THEME_PATH,
        DEFAULT_THEME_PATH,
        DEFAULT_THEME,
        SELECTABLE_THEMES
    )
)

if CUSTOM_THEME_PATH is not None:
    _LOG.warning("CUSTOM_THEME_PATH has been deprecated.  Please convert "
                 "your settings to make use of AVAILABLE_THEMES.")

if DEFAULT_THEME_PATH is not None:
    _LOG.warning("DEFAULT_THEME_PATH has been deprecated.  Please convert "
                 "your settings to make use of AVAILABLE_THEMES.")

# Discover all the directories that contain static files; at the same time
# discover all the xstatic module entry points to embed in our HTML
示例#2
0
if MEDIA_ROOT is None:
    MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media'))

if MEDIA_URL is None:
    MEDIA_URL = WEBROOT + 'media/'

if STATIC_ROOT is None:
    STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static'))

if STATIC_URL is None:
    STATIC_URL = WEBROOT + 'static/'

AVAILABLE_THEMES, DEFAULT_THEME = theme_settings.get_available_themes(
    AVAILABLE_THEMES,
    CUSTOM_THEME_PATH,
    DEFAULT_THEME_PATH,
    DEFAULT_THEME
)

STATICFILES_DIRS = get_staticfiles_dirs(STATIC_URL) + \
    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 "
示例#3
0
    LOGIN_REDIRECT_URL = WEBROOT

if MEDIA_ROOT is None:
    MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media'))

if MEDIA_URL is None:
    MEDIA_URL = WEBROOT + 'media/'

if STATIC_ROOT is None:
    STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static'))

if STATIC_URL is None:
    STATIC_URL = WEBROOT + 'static/'

AVAILABLE_THEMES, SELECTABLE_THEMES, DEFAULT_THEME = (
    theme_settings.get_available_themes(AVAILABLE_THEMES, DEFAULT_THEME,
                                        SELECTABLE_THEMES))

# Discover all the directories that contain static files
STATICFILES_DIRS = theme_settings.get_theme_static_dirs(
    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')

    # pylint: disable=ungrouped-imports
    from horizon.utils import secret_key
示例#4
0
文件: settings.py 项目: mahak/horizon
)

# 'key', 'label', 'path'
AVAILABLE_THEMES = [
    (
        'default',
        pgettext_lazy('Default style theme', 'Default'),
        'themes/default'
    ), (
        'material',
        pgettext_lazy("Google's Material Design style theme", "Material"),
        'themes/material'
    ),
]
AVAILABLE_THEMES, SELECTABLE_THEMES, DEFAULT_THEME = \
    theme_settings.get_available_themes(AVAILABLE_THEMES, 'default', None)

# Theme Static Directory
THEME_COLLECTION_DIR = 'themes'

COMPRESS_OFFLINE = False

INSTALLED_APPS = (
    'django.contrib.contenttypes',
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.staticfiles',
    'django.contrib.messages',
    'django.contrib.humanize',
    'openstack_auth',
    'compressor',
示例#5
0
)

# 'key', 'label', 'path'
AVAILABLE_THEMES = [
    (
        'default',
        pgettext_lazy('Default style theme', 'Default'),
        'themes/default'
    ), (
        'material',
        pgettext_lazy("Google's Material Design style theme", "Material"),
        'themes/material'
    ),
]
AVAILABLE_THEMES, SELECTABLE_THEMES, DEFAULT_THEME = \
    theme_settings.get_available_themes(AVAILABLE_THEMES, 'default', None)

# Theme Static Directory
THEME_COLLECTION_DIR = 'themes'

COMPRESS_OFFLINE = False

INSTALLED_APPS = (
    'django.contrib.contenttypes',
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.staticfiles',
    'django.contrib.messages',
    'django.contrib.humanize',
    'openstack_auth',
    'compressor',
示例#6
0
if MEDIA_ROOT is None:
    MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media'))

if MEDIA_URL is None:
    MEDIA_URL = WEBROOT + 'media/'

if STATIC_ROOT is None:
    STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'static'))

if STATIC_URL is None:
    STATIC_URL = WEBROOT + 'static/'

AVAILABLE_THEMES, SELECTABLE_THEMES, DEFAULT_THEME = (
    theme_settings.get_available_themes(
        AVAILABLE_THEMES,
        DEFAULT_THEME,
        SELECTABLE_THEMES
    )
)

# Discover all the directories that contain static files
STATICFILES_DIRS = theme_settings.get_theme_static_dirs(
    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')