diff options
author | raylu <raylu@cmu.edu> | 2011-05-16 01:22:19 -0400 |
---|---|---|
committer | raylu <raylu@cmu.edu> | 2011-05-16 01:22:19 -0400 |
commit | 430728cb260985786bb5dd594843a2962270b22d (patch) | |
tree | 326f5cfe92f749563c8367761e4645a7afdf6294 | |
parent | f60a3158947a566518522af14ec4b92acfaea3d1 (diff) | |
download | pyc-430728cb260985786bb5dd594843a2962270b22d.tar.xz |
Cache labs
-rw-r--r-- | pyc/settings.py | 7 | ||||
-rw-r--r-- | pyc/templates/base.html | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pyc/settings.py b/pyc/settings.py index 5a903e7..4cef68b 100644 --- a/pyc/settings.py +++ b/pyc/settings.py @@ -157,3 +157,10 @@ LOGGING = { }, } } + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + 'TIMEOUT': 60, + } + } diff --git a/pyc/templates/base.html b/pyc/templates/base.html index 00dac18..370f8d7 100644 --- a/pyc/templates/base.html +++ b/pyc/templates/base.html @@ -11,6 +11,8 @@ {% block body %}{% endblock %} </div> <div id="nav"> + {% load cache %} + {% cache 30 nav %} <div class="nav"> <a href="{% url grader.views.index %}">Home</a> @@ -23,6 +25,7 @@ <a href="{% url grader.views.faq %}">FAQ</a> </div> + {% endcache %} <div class="nav"> {% if authenticated %} <a href="{% url django.contrib.auth.views.password_change %}">Change Password</a> |