Boston Python Workshop/Saturday/Web app project: Difference between revisions

imported>Paulproteus
imported>Paulproteus
Line 432:
)
 
This is worth a review. When somebody requests a page from your Web site -- say, "/polls/23/", Django will load the ''urls.py'' Python module, because it's pointed to by the ROOT_URLCONF setting. It finds the variable named urlpatterns and traverses the regular expressions in order. When it finds a regular expression that matches -- r'^polls/(?P<poll_id>\d+)/$' -- it loads the function detail() from polls/views.py. Finally, it calls that detail() function like so:
 
detail(request=<HttpRequest object>, '23')
Anonymous user