Skip to content

Commit

Permalink
Using the models rather than hardcoded values.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinabrahms committed Feb 3, 2011
1 parent 2459516 commit 61c6eb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion django_website/context_processors.py
Original file line number Diff line number Diff line change
@@ -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}
1 change: 0 additions & 1 deletion django_website/settings/www.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"

0 comments on commit 61c6eb6

Please sign in to comment.