Archivo de agosto 2010
Tutorial de Django – VII
Vistas y URLconfs avanzadas
Trucos URLconf
No hay nada “especial” en URLconfs – como todo en Django, sólo código Python.
Racionalizar las importaciones de funciones
Considerar la siguiente URLconf, basada en un ejemplo visto anteriormente:
from django.conf.urls.defaults import *
from mysite.views import hello, current_datetime, hours_aheadurlpatterns = patterns(”,
(r’^hello/$’, hello),
(r’^time/$’, current_datetime),
(r’^time/plus/(\d{1,2})/$’, hours_ahead),)
