aboutsummaryrefslogtreecommitdiff
path: root/dicoweb/settings-sample.py
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2010-11-13 16:26:32 +0100
committerWojciech Polak <polak@gnu.org>2010-11-13 16:28:48 +0100
commit555fb2658a1a0e3f22b0bf5270cd79095003b059 (patch)
tree86336d13c9910041fec4d02dced38d9dd5c63159 /dicoweb/settings-sample.py
parenta988fc5f4974207d0fdf86dbfd32f84222e97fb3 (diff)
downloaddico-555fb2658a1a0e3f22b0bf5270cd79095003b059.tar.gz
dico-555fb2658a1a0e3f22b0bf5270cd79095003b059.tar.bz2
Switch to Django's cache framework (from direct Memcached).
* dicoweb/dicoclient/dicoclient.py: Minor code changes. * dicoweb/dicoclient/dicoshell.py: Likewise. * dicoweb/settings-sample.py: Add sample CACHE_BACKEND. * dicoweb/views.py: Use Django's cache framework.
Diffstat (limited to 'dicoweb/settings-sample.py')
-rw-r--r--dicoweb/settings-sample.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/dicoweb/settings-sample.py b/dicoweb/settings-sample.py
index aeb8a8c..39dcee8 100644
--- a/dicoweb/settings-sample.py
+++ b/dicoweb/settings-sample.py
@@ -1,7 +1,7 @@
# Django settings for Dicoweb project.
#
# This file is part of GNU Dico.
-# Copyright (C) 2008, 2009 Wojciech Polak
+# Copyright (C) 2008, 2009, 2010 Wojciech Polak
#
# GNU Dico is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -45,6 +45,9 @@ SESSION_COOKIE_NAME = 'dicoweb_sid'
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
+# Caching, see http://docs.djangoproject.com/en/dev/topics/cache/#topics-cache
+CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
+
# Absolute path to the directory that holds media/static files.
MEDIA_ROOT = os.path.join (SITE_ROOT, 'static')
@@ -61,10 +64,12 @@ TEMPLATE_LOADERS = (
)
MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.gzip.GZipMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.cache.FetchFromCacheMiddleware',
)
ROOT_URLCONF = 'dicoweb.urls'
@@ -82,4 +87,3 @@ INSTALLED_APPS = (
DICT_SERVERS = ('gnu.org.ua',)
DICT_TIMEOUT = 10
-MEMCACHE_SERVERS = ('127.0.0.1:11211',)

Return to:

Send suggestions and report system problems to the System administrator.