Commit 7184d676 by David Ormsbee

change config to not cache by default, unless overridden by server-specific settings.py

--HG--
branch : cache_separation
parent e18a98b3
...@@ -158,10 +158,7 @@ def user_groups(user): ...@@ -158,10 +158,7 @@ def user_groups(user):
cache_expiration = 60 * 60 # one hour cache_expiration = 60 * 60 # one hour
# Kill caching on dev machines -- we switch groups a lot # Kill caching on dev machines -- we switch groups a lot
if "dev" not in settings.DEFAULT_GROUPS: group_names = cache.get(fasthash(key))
group_names = cache.get(fasthash(key))
else:
group_names = None
if group_names is None: if group_names is None:
group_names = [u.name for u in UserTestGroup.objects.filter(users=user)] group_names = [u.name for u in UserTestGroup.objects.filter(users=user)]
......
...@@ -163,6 +163,13 @@ MAKO_TEMPLATES = {} ...@@ -163,6 +163,13 @@ MAKO_TEMPLATES = {}
LOGGING_ENV = "dev" # override this in different environments LOGGING_ENV = "dev" # override this in different environments
# Default dev cache (i.e. no caching)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# Make sure we execute correctly regardless of where we're called from # Make sure we execute correctly regardless of where we're called from
execfile(os.path.join(BASE_DIR, "settings.py")) execfile(os.path.join(BASE_DIR, "settings.py"))
......
...@@ -6,6 +6,7 @@ Note that 'default' is being preserved for user session caching, which we're ...@@ -6,6 +6,7 @@ Note that 'default' is being preserved for user session caching, which we're
not migrating so as not to inconvenience users by logging them all out. not migrating so as not to inconvenience users by logging them all out.
""" """
from django.core import cache from django.core import cache
import settings
# If we can't find a 'general' CACHE defined in settings.py, we simply fall back # If we can't find a 'general' CACHE defined in settings.py, we simply fall back
# to returning the default cache. This will happen with dev machines. # to returning the default cache. This will happen with dev machines.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment