from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^$', "main.views.index"),
(r'^contact-us/$', "main.views.contact_us"),
)
可以简写为:
from django.conf.urls.defaults import *
urlpatterns = patterns('main.views',
(r'^$', "index"),
(r'^contact-us/$', "contact_us"),
)
pattern的第一个参数是一个前缀
urlpatterns = patterns('',
(r'^$', "main.views.index"),
(r'^contact-us/$', "main.views.contact_us"),
)
可以简写为:
from django.conf.urls.defaults import *
urlpatterns = patterns('main.views',
(r'^$', "index"),
(r'^contact-us/$', "contact_us"),
)
pattern的第一个参数是一个前缀
No comments:
Post a Comment