Simple question.
How can I pass a variable from the URL to the view? I\'m following the Date Example.
My view needs to arguments:
def hours_
From chapter 3 of the django book:
Now that we've designated a wildcard for the URL, we need a way of passing that wildcard data to the view function, so that we can use a single view function for any arbitrary hour offset. We do this by placing parentheses around the data in the URLpattern that we want to save. In the case of our example, we want to save whatever number was entered in the URL, so let's put parentheses around the \d{1,2}, like this:
(r'^time/plus/(\d{1,2})/$', hours_ahead),
If you're familiar with regular expressions, you'll be right at home here; we're using parentheses to capture data from the matched text.