Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead. url(r'^$', archive),
原始代码 案例一
from django.conf.urls import include, url
urlpatterns=[
url(r'^admin/', include(admin.site.urls)),
url(........),
]
案例二
urlpatterns =patterns('',
url(r'^$', archive),
)
都是不可行的
案例一改成
from django.conf.urls import *
from HelloWorld.view import hello
'''''
from django.conf.urls import patterns, url
'''
urlpatterns = [
url('^hello/$', hello),
]
案例二
from django.conf.urls import *
from blog.views import archive
urlpatterns =[
url(r'^$', archive),
]
即可