Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Using the models rather than hardcoded values.

  • Loading branch information...
commit 61c6eb61220938e2da50e4f4b10be22ad5bc629d 1 parent 2459516
@justinabrahms justinabrahms authored
View
9 django_website/context_processors.py
@@ -1,4 +1,11 @@
from django.conf import settings
+from django.core.cache import cache
+
+from django_website.docs.models import DocumentRelease
def recent_release(request):
- return {'RECENT_RELEASE': settings.RECENT_RELEASE}
+ recent_release = cache.get('recent_release')
+ if not recent_release:
+ recent_release = DocumentRelease.objects.default().version
+ cache.set('recent_release', recent_release)
+ return {'RECENT_RELEASE': recent_release}
View
1  django_website/settings/www.py
@@ -100,7 +100,6 @@
# setting for documentation root path
DJANGO_DOCUMENT_ROOT_PATH = "/home/html/djangoproject.com/docs/"
DJANGO_TESTS_PATH = "/home/html/djangoproject.com/tests/"
-RECENT_RELEASE = "1.2"
# XXX What's this for?
DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/"
Please sign in to comment.
Something went wrong with that request. Please try again.