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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -