I have a pretty standard django application, and I am wondering how to configure URL routing so that I cannot explicitly map each URL to a view.
For example, let's say that I have the following views: Project, Links, Profile, Contact . I would prefer my urlpatterns look like this:
(r'^Project/$', 'mysite.app.views.project'), (r'^Links/$', 'mysite.app.views.links'), (r'^Profile/$', 'mysite.app.views.profile'), (r'^Contact/$', 'mysite.app.views.contact'),
And so on. In Pylons, it would be simple:
map.connect(':controller/:action/:id')
And it will automatically capture the right controller and function. Is there something similar in Django?
python django pylons
swilliams
source share