from django.conf.urls import * from django.views.generic.base import RedirectView from django.views.generic.detail import DetailView from links.models import Link urlpatterns = patterns('', (r'^$', RedirectView.as_view(url="/links/1/")), (r'^(?P\d+)/$', DetailView.as_view(model=Link, template_name='details/link.html')), )