【发布时间】:2015-10-24 01:56:18
【问题描述】:
我现在刚开始使用 django,正在配置 url。我能够映射不同的 url,如 /posts、/posts/create 等。不知何故,我无法配置根 url,我不确定我在做什么错。这是我的配置:
urlpatterns = [
# Examples:
url(r'',homeViews.posts),
# url(r'^blog/', include('blog.urls')),
url(r'^posts/',homeViews.posts),
url(r'^createPost/',homeViews.createPost),
url(r'^createUser/',userViews.createUser),
url(r'^post/(?P<title>[a-z,A-Z]+)/$',homeViews.post),
]`
干杯!
【问题讨论】: