-1

I am very new, and I am doing a tutorial, that is a little bit old. I keep getting an error that this cannot import name 'patterns' then something about include, then syntax and so on. So what is wrong this section? How would I write it current day? Thank you for your time.

    from django.conf.urls import patterns, include, url
    from django.contrib import admin
    from djangonote.views import home_view


    urlpatterns = patterns('',
        url(r'^$', home_view, name='home'),
        url(r'^notes/', include('notes.urls', namespace='notes')),
    )

The reply below fixed that issue, thank you Exprator! I now get the issue: NameError: name 'notes' is not defined. What does that mean? Ty for your time.

1 Answers1

1
    from django.conf.urls import  include, url
    from django.contrib import admin
    from djangonote.views import home_view


    urlpatterns = [
        url(r'^$', home_view, name='home'),
        url(r'^notes/', include('notes.urls', namespace='notes')),
]
Exprator
  • 26,992
  • 6
  • 47
  • 59
  • Thank you for your answer! That definitely fixed that problem. When I try to run the server, I get the error: NameError: name 'notes' is not defined....what does that mean? – Rose Robinson Jun 20 '17 at 18:07
  • can you post the full stacktrace so that it will be easy for us to understand where exactly the error is – Exprator Jun 21 '17 at 03:35