django url包含多个url不起作用

时间:2017-02-08 23:42:42

标签: python django python-3.x url routes

所以我有这段代码:

urls.py

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^myapp/', include('myapp.urls')),
]

myapp.py

from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^what/', views.do_something),
]

去myapp /工作,但去myapp /什么不工作,最终返回404页面找不到...

我做错了什么?

0 个答案:

没有答案