From 37fd3cc7f406d79f522b0831a7e1b7c4ffd37654 Mon Sep 17 00:00:00 2001 From: Alex Meng Date: Tue, 12 Feb 2013 15:23:39 -0500 Subject: Updated example to use class-based generic views Django dropped the function-based generic views in favor of class-based generic views.  The transition is outlined here: https://docs.djangoproject.com/en/1.4/topics/generic-views-migration/--- example/urls.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'example') diff --git a/example/urls.py b/example/urls.py index 25acc31..d8bed27 100644 --- a/example/urls.py +++ b/example/urls.py @@ -1,15 +1,15 @@ from django.conf import settings from django.conf.urls.defaults import * from django.contrib import admin -from django.views.generic.simple import direct_to_template +from django.views.generic import TemplateView admin.autodiscover() urlpatterns = patterns('', - (r'^$', direct_to_template, {'template': 'index.html'}), - (r'^jquery/index/$', direct_to_template, {'template': 'jquery/index.html'}), - (r'^mootools/index/$', direct_to_template, {'template': 'mootools/index.html'}), - (r'^prototype/index/$', direct_to_template, {'template': 'prototype/index.html'}), + (r'^$', TemplateView.as_view(template_name='index.html')), + (r'^jquery/index/$', TemplateView.as_view(template_name='jquery/index.html')), + (r'^mootools/index/$', TemplateView.as_view(template_name='mootools/index.html')), + (r'^prototype/index/$', TemplateView.as_view(template_name='prototype/index.html')), (r'^admin/', include(admin.site.urls)), ) -- cgit v1.2.3