python - can not import patterns in django 1.11.4 -
my project urls.py follows:
from django.conf.urls import include, url django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^myapp/', include('myapp.urls')), ]
my app urls.py follows:
from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^hello/', 'myapp.views.hello', name = 'hello'),)
now , try run , gives me following error:
django.conf.urls import patterns, include, url importerror: cannot import name 'patterns'
django doesn't require use patterns anymore, can make urlpatterns
list of urls
urlpatterns = [url(r'^hello/', 'myapp.views.hello', name = 'hello'),]
Comments
Post a Comment