diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-02-03 18:28:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-10 23:07:48 +0000 |
commit | b741c9a4b4047439c6c5428e36a72c22a784feda (patch) | |
tree | 8a92b6d9ac5137464b591ffa0e6683f3c7810242 /bitbake | |
parent | d72f1982ee282a481054326571dd63cceb22415b (diff) | |
download | ast2050-yocto-poky-b741c9a4b4047439c6c5428e36a72c22a784feda.zip ast2050-yocto-poky-b741c9a4b4047439c6c5428e36a72c22a784feda.tar.gz |
bitbake: toaster: enable server-side caches and debug-panel
This patch enables the server-side caches for Django using
file cache in /tmp/ directory.
Patch enables django debug panel if available.
(Bitbake rev: 00496fb67fa341477edbf80c5438f0b069871ac6)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index acc20cc..7cf9052 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -211,10 +211,25 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.cache.UpdateCacheMiddleware', + 'django.middleware.cache.FetchFromCacheMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) +CACHES = { + # 'default': { + # 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + # 'LOCATION': '127.0.0.1:11211', + # }, + 'default': { + 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/tmp/django-default-cache', + 'TIMEOUT': 5, + } + } + + from os.path import dirname as DN SITE_ROOT=DN(DN(os.path.abspath(__file__))) @@ -252,17 +267,41 @@ INSTALLED_APPS = ( ) +INTERNAL_IPS = ['127.0.0.1', '192.168.2.28'] + # Load django-fresh is TOASTER_DEVEL is set, and the module is available FRESH_ENABLED = False if os.environ.get('TOASTER_DEVEL', None) is not None: try: import fresh - MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES = ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES INSTALLED_APPS = INSTALLED_APPS + ('fresh',) FRESH_ENABLED = True except: pass +DEBUG_PANEL_ENABLED = False +if os.environ.get('TOASTER_DEVEL', None) is not None: + try: + import debug_toolbar, debug_panel + MIDDLEWARE_CLASSES = ('debug_panel.middleware.DebugPanelMiddleware',) + MIDDLEWARE_CLASSES + #MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',) + INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',) + DEBUG_PANEL_ENABLED = True + + # this cache backend will be used by django-debug-panel + CACHES['debug-panel'] = { + 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': '/var/tmp/debug-panel-cache', + 'TIMEOUT': 300, + 'OPTIONS': { + 'MAX_ENTRIES': 200 + } + } + + except: + pass + SOUTH_TESTS_MIGRATE = False |