Mercurial > public > bravenewsurf
comparison bns_website/urls.py @ 6:48ff23eab86a
Enabled the admin. Created a "bands" app with a band model.
Created a generic view to display the bands.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 29 Oct 2011 17:11:58 -0500 |
parents | 71f2941161e9 |
children | f2cb9b2ec552 |
comparison
equal
deleted
inserted
replaced
5:04991ccaf30c | 6:48ff23eab86a |
---|---|
1 from django.conf.urls.defaults import patterns, include, url | 1 from django.conf.urls.defaults import patterns, include, url |
2 #from django.contrib import admin | 2 from django.contrib import admin |
3 from django.views.generic.base import TemplateView | 3 from django.views.generic.base import TemplateView |
4 from django.views.generic import ListView | |
4 | 5 |
6 from bands.models import Band | |
5 | 7 |
6 #admin.autodiscover() | 8 admin.autodiscover() |
7 | 9 |
8 urlpatterns = patterns('', | 10 urlpatterns = patterns('', |
9 url(r'^$', | 11 url(r'^$', |
10 TemplateView.as_view(template_name="home.html"), | 12 TemplateView.as_view(template_name="home.html"), |
11 name="home"), | 13 name="home"), |
14 url(r'^bands/$', | |
15 ListView.as_view(model=Band), | |
16 name="bands"), | |
12 | 17 |
13 # Examples: | 18 # Examples: |
14 # url(r'^$', 'bns_website.views.home', name='home'), | 19 # url(r'^$', 'bns_website.views.home', name='home'), |
15 # url(r'^bns_website/', include('bns_website.foo.urls')), | 20 # url(r'^bns_website/', include('bns_website.foo.urls')), |
16 | 21 |
17 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), | 22 url(r'^admin/doc/', include('django.contrib.admindocs.urls')), |
18 # url(r'^admin/', include(admin.site.urls)), | 23 url(r'^admin/', include(admin.site.urls)), |
19 ) | 24 ) |