DjangoのURLメモ


from django.conf.urls import include, url

urlpatterns = [
url(r’^$’, index, name=’index’)),
url(r’^foo/’, include(foo.urls, namespace=’foo’)),
url(r’^bar/(?P\d{4})/?$', bar, {'foo': 'bar'}, name='bar'), // パラメータを指定する ]

{% url ‘namespace:name’ param %}

*


Djangoメモ