custom_settings: ajout configuration cachalot

This commit is contained in:
Benjamin Dauvergne 2017-06-26 11:39:38 +02:00
parent 9fd3490930
commit af98a203e7
1 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,5 @@
from authentic2.settings import INSTALLED_APPS, CACHES
A2_MANAGER_SHOW_INTERNAL_ROLES = True
A2_MANAGER_ROLE_MEMBERS_FROM_OU = True
A2_RBAC_MANAGED_CONTENT_TYPES = ()
@ -7,3 +9,18 @@ A2_CUT_PARTNERS = [
'name': u'Ville de Lyon',
}
]
if ('Memcached' in CACHES['default']['BACKEND'] or 'Memcached' in
CACHES['default'].get('REAL_BACKEND', '')):
try:
import cachalot
INSTALLED_APPS += ('cachalot',)
from cachalot import settings
settings.SUPPORTED_DATABASE_ENGINES.add('tenant_schemas.postgresql_backend')
settings.SUPPORTED_CACHE_BACKENDS.add('hobo.multitenant.cache.TenantCache')
except ImportError as e:
print 'canot load django-cachalot', e
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
# CACHALOT_UNCACHABLE_TABLES = ('custom_user_user', 'django_migrations')