diff 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
line wrap: on
line diff
--- a/bns_website/urls.py	Fri Oct 28 21:58:54 2011 -0500
+++ b/bns_website/urls.py	Sat Oct 29 17:11:58 2011 -0500
@@ -1,19 +1,24 @@
 from django.conf.urls.defaults import patterns, include, url
-#from django.contrib import admin
+from django.contrib import admin
 from django.views.generic.base import TemplateView
+from django.views.generic import ListView
 
+from bands.models import Band
 
-#admin.autodiscover()
+admin.autodiscover()
 
 urlpatterns = patterns('',
-    url(r'^$', 
+    url(r'^$',
         TemplateView.as_view(template_name="home.html"),
         name="home"),
+    url(r'^bands/$',
+        ListView.as_view(model=Band),
+        name="bands"),
 
     # Examples:
     # url(r'^$', 'bns_website.views.home', name='home'),
     # url(r'^bns_website/', include('bns_website.foo.urls')),
 
-    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-    # url(r'^admin/', include(admin.site.urls)),
+    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+    url(r'^admin/', include(admin.site.urls)),
 )