summaryrefslogtreecommitdiff
path: root/retro/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-02 14:12:46 -0600
committerDan McGee <dan@archlinux.org>2012-02-18 19:24:33 -0600
commit48f51dea411885e510cb9aa2887e83be289232f6 (patch)
tree5ca028fadb46ea1fffa351d3644983df273519cf /retro/views.py
parent03a0d27971898592698dbb0c5948b93c6a3a4741 (diff)
Add a retro site view and link it to a URL
This is from our friends at web.archive.org, who's earliest capture of the Arch Linux website was on March 28, 2002. Seems like something nice to do around the 10th anniversary of the website being up and the distro being around, and not hotlinking their servers also seems like a good idea. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'retro/views.py')
-rw-r--r--retro/views.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/retro/views.py b/retro/views.py
new file mode 100644
index 00000000..ba1109b0
--- /dev/null
+++ b/retro/views.py
@@ -0,0 +1,19 @@
+from django.http import Http404
+from django.views.decorators.cache import cache_page
+from django.views.generic.simple import direct_to_template
+
+
+RETRO_YEAR_MAP = {
+ 2002: 'index-20020328.html',
+}
+
+
+@cache_page(1800)
+def retro_homepage(request, year):
+ year = int(year)
+ template = RETRO_YEAR_MAP.get(year, None)
+ if template is None:
+ raise Http404
+ return direct_to_template(request, 'retro/%s' % template, {})
+
+# vim: set ts=4 sw=4 et: