Commits

Ed Brannin  committed 7895f88

Refactored the URLs a bit, per the tutorial.

  • Participants
  • Parent commits e96af37

Comments (0)

Files changed (3)

File baptism_records/baptism/urls.py

+from django.conf.urls.defaults import *
+
+# Uncomment the next two lines to enable the admin:
+urlpatterns = patterns('baptism_records.baptism.views',
+    (r'^$', 'index'),
+    (r'^(?P<christian_id>\d+)/$', 'detail'),
+)

File baptism_records/templates/baptism/index.html

 {% if people %}
     <ul>
     {% for person in people %}
-        <li><a href="/christians/{{ person.id }}/">{{ person.full_name }}</a></li>
+        <li><a href="/baptism/{{ person.id }}/">{{ person.full_name }}</a></li>
     {% endfor %}
     </ul>
 {% else %}

File baptism_records/urls.py

 from django.contrib import admin
 admin.autodiscover()
 
+import baptism_records.baptism.urls
+
 urlpatterns = patterns('',
     # Example:
     # (r'^baptism_records/', include('baptism_records.foo.urls')),
 
     # Uncomment the next line to enable the admin:
     (r'^admin/', include(admin.site.urls)),
-    
-    (r'^baptism/(?P<christian_id>\d+)', 'baptism_records.baptism.views.detail'),
-    (r'^baptism/', 'baptism_records.baptism.views.index'),
+    (r'^baptism/', include(baptism_records.baptism.urls)),
 )