I am trying to write urlconf file so that there is an index or home
page. If none of the patterns match, it should, by default, go to that
page. For example, a sample urlconf could be

urlpatterns = patterns('',
    (r'^time/$', current_datetime),
    (r'^time/plus/(\d{1,2})/$', hours_ahead),
)

If the user enters http://www.example.com/time/ they are handled by
that pattern. But there are two scenarios I am interested in:

(a) the user types http://www.example.com/
(b) the user types http://www.example.com/somethingelse/

Both of these are not handled by the sample urlconf. However, in both
situations, I would like the user to be redirected to a default page,
which would be the home or index page.

In short, is there such a thing as 'default' in urlpatterns so that it
calls a view when none of the other patterns match?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to