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