Django URL不起作用

时间:2015-03-25 18:16:24

标签: python django

转到localhost / app有效,但localhost / app / upload却没有。我做的事情显然是错的吗?我没有运气就按照文档尝试了几种不同的方法。我得到一个404说URL模式不匹配。

/project/app/urls.py

from app import views

urlpatterns = patterns('',
    url(r'^$', views.view, name='result'),
    url(r'^upload/$', views.upload, name='upload'),

)

/project/urls.py

urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^app/$', include('app.urls')),

)

1 个答案:

答案 0 :(得分:2)

不要终止包含网址。

url(r'^app/', include('app.urls')),