I am brand new to Django, so bare with me.
-- I am a little confused with this example shown in the Django book:
Here is my urls.py:
And here is my View function associated with hours_ahead
Now what is throwing me off is how 'offset' is a second argument to the hours_ahead function. Yet I am not quite sure how it being the second argument makes it the case that it is associated with whatever is entered as a URL. Let me use an example to illustrate my confusion.
Say I request the URL: http://127.0.0.1:8000/time/plus/2/ . Why is it the case that offset is '2'? I am not seeing why '2' is plucked out? What happened with 'time' and 'plus'? How does python/django know that the '2' is referring to offset?
Thanks for any help in advance.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/eb2a0ef3-983d-41f9-8aea-225bf4174287%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment