In my Django project, my url.py module looks something like this:
urlpatterns = patterns('',
(r'^$', 'web.views.home.index'),
(r'^home/index', 'web.views.home.index'),
(r'^home/login', 'web.views.home.login'),
(r'^home/logout', 'web.views.home.logout'),
(r'^home/register', 'web.views.home.register'),
)
Is there a way to simplify this so that I don't need an entry for every method in my view? Something like this would be nice:
urlpatterns = patterns('',
(r'^$', 'web.views.home.index'),
(r'^home/(?<method_name>.*)', 'web.views.home.(?P=method_name)'),
)
UPDATE
Now that I know at least one way to do this, is this sort of thing recommended? Or is there a good reason to explicitly create a mapping for each individual method?