Skip to content

Commit ee1996e

Browse files
committed
Merge pull request #355 from AMeng/patch-1
Updated example to use class-based generic views
2 parents fb412f7 + 37fd3cc commit ee1996e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

example/urls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from django.conf import settings
22
from django.conf.urls.defaults import *
33
from django.contrib import admin
4-
from django.views.generic.simple import direct_to_template
4+
from django.views.generic import TemplateView
55

66
admin.autodiscover()
77

88
urlpatterns = patterns('',
9-
(r'^$', direct_to_template, {'template': 'index.html'}),
10-
(r'^jquery/index/$', direct_to_template, {'template': 'jquery/index.html'}),
11-
(r'^mootools/index/$', direct_to_template, {'template': 'mootools/index.html'}),
12-
(r'^prototype/index/$', direct_to_template, {'template': 'prototype/index.html'}),
9+
(r'^$', TemplateView.as_view(template_name='index.html')),
10+
(r'^jquery/index/$', TemplateView.as_view(template_name='jquery/index.html')),
11+
(r'^mootools/index/$', TemplateView.as_view(template_name='mootools/index.html')),
12+
(r'^prototype/index/$', TemplateView.as_view(template_name='prototype/index.html')),
1313
(r'^admin/', include(admin.site.urls)),
1414
)
1515

0 commit comments

Comments
 (0)