raylu 14 жил өмнө
parent
commit
430728cb26

+ 7 - 0
pyc/settings.py

@@ -157,3 +157,10 @@ LOGGING = {
 		},
 	}
 }
+
+CACHES = {
+	'default': {
+		'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
+		'TIMEOUT': 60,
+		}
+	}

+ 3 - 0
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>