microstack/snap-overlay/lib/python3.6/site-packages/openstack_dashboard/local/local_settings.d/_05_snap_tweaks.py

54 lines
1.8 KiB
Python

# Tweaks to make this run nicely in a snap.
# TODO: turn this off once everything is working nicely.
DEBUG = True
# Set our webroot.
WEBROOT = '/'
# Caches and such should get written out here.
LOCAL_PATH = '/var/snap/microstack/common/etc/horizon/'
# We don't want django to try writing the secret key before we've told
# it not to attempt to write it out in the read only snap dir in our
# local_settings.py. So we override the behavior of the default
# settings.py here.
SECRET_KEY = secret_key.generate_or_read_from_file(
os.path.join(LOCAL_PATH, '.secret_key_store'))
# Django wants to write out compressed files even when we turn
# compression off (either a bug or something that I'm not
# understanding). Tell it to write them some place writeable.
STATIC_ROOT = '/var/snap/microstack/common/var/horizon/static'
# Disable extra themes for now. TODO: Re-enable when
# https://github.com/CanonicalLtd/microstack/issues/39 is
# addressed. (You'll need to uncomment the material theme below when testing
# the fix.)
AVAILABLE_THEMES = [
('default', 'Default', 'themes/default'),
# ('material', 'Material', 'themes/material'),
('ubuntu', 'Ubuntu', 'themes/ubuntu'),
]
# Point us at keystone.
OPENSTACK_HOST = "10.20.20.1"
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
# Turn off external access for now. (This should be turned on once we
# have hooks for setting a non default password.)
ALLOWED_HOSTS = ['10.20.20.1', 'localhost', '127.0.0.1']
# Use memcached as our caching backend.
CACHES = {
'default': {
#
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '10.20.20.1:11211',
}
}
SESSION_ENGINE='django.contrib.sessions.backends.cache'