Permalink
Browse files

Added shortcut redirects for tickets and changesets.

  • Loading branch information...
1 parent 2702cc5 commit 9432cfd7258d17dc761b1d45e469fc7ab9055a36 @jacobian jacobian committed Oct 22, 2010
Showing with 7 additions and 5 deletions.
  1. +1 −1 settings.py
  2. +6 −4 urls.py
View
@@ -15,7 +15,7 @@
MIDDLEWARE_CLASSES = []
SITE_ID = 1
-SECRET_KEY = open('/home/web/sekrit.txt').read().strip()
+SECRET_KEY = 'LOCAL' if DEBUG else open('/home/web/sekrit.txt').read().strip()
ROOT_URLCONF = 'djangome.urls'
INSTALLED_APPS = ['djangome', 'gunicorn']
View
@@ -1,8 +1,10 @@
from django.conf.urls.defaults import *
-from django.views.generic.simple import redirect_to
+from django.views.generic import RedirectView
urlpatterns = patterns('',
- url('^$', redirect_to, {'url': 'http://docs.djangoproject.com/en/dev/'}),
- url('^([\w-]+)$', 'djangome.views.redirect_to_term', name='redirect_to_term'),
- url('^([\w-]+)/stats$', 'djangome.views.show_term', name='show_term'),
+ url('^$', RedirectView.as_view(url='http://docs.djangoproject.com/en/dev/')),
+ url('^t(?P<n>\d+)$', RedirectView.as_view(url='http://code.djangoproject.com/ticket/%(n)s')),
+ url('^r(?P<n>\d+)$', RedirectView.as_view(url='http://code.djangoproject.com/changeset/%(n)s')),
+ url('^([\w\-\.]+)$', 'djangome.views.redirect_to_term', name='redirect_to_term'),
+ url('^([\w\-\.]+)/stats$', 'djangome.views.show_term', name='show_term'),
)

0 comments on commit 9432cfd

Please sign in to comment.