diff options
| author | Alex Meng | 2013-02-12 15:23:39 -0500 |
|---|---|---|
| committer | Alex Meng | 2013-02-12 15:23:39 -0500 |
| commit | 37fd3cc7f406d79f522b0831a7e1b7c4ffd37654 (patch) | |
| tree | 2374d3aed03966bdfb38869e1e6b65bd610a6924 /example/urls.py | |
| parent | 21d162c3232a8b49c053e06c3cc27b17776d8ccb (diff) | |
| download | django-debug-toolbar-37fd3cc7f406d79f522b0831a7e1b7c4ffd37654.tar.bz2 | |
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/
Diffstat (limited to 'example/urls.py')
| -rw-r--r-- | example/urls.py | 10 |
1 files changed, 5 insertions, 5 deletions
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)), ) |
