from django.conf.urls import include, url

from tutorials import views

urlpatterns = [
    url(r'^$', views.ListTutorials.as_view()),
    url(r'add/', views.NewTutorial.as_view(), name='add_tutorial'),
    url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tutorial'),

    # This must be last, otherwise it will match anything
    url(r'^(?P<tutorial_id>[\w\-]+)/$', views.TutorialDetail.as_view(), name='detail_tutorial'),
]
from django.conf.urls import include, url

from tutorials import views

urlpatterns = [
    url(r'^$', views.ListTutorials.as_view(), name='list_tutorials'),
    url(r'add/', views.CreateNewTutorial.as_view(), name='add_tutorial'),
    url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tutorial'),
    url(r'(?P<tutorial_id>[\w\-]+)/delete/', views.DeleteTutorial.as_view(), name='delete_tutorial'),

    # This must be last, otherwise it will match anything
    url(r'^(?P<tutorial_id>[\w\-]+)/$', views.TutorialDetail.as_view(), name='detail_tutorial'),
]
Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials
Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials

  from django.conf.urls import include, url
  
  from tutorials import views
  
  urlpatterns = [
-     url(r'^$', views.ListTutorials.as_view()),
+     url(r'^$', views.ListTutorials.as_view(), name='list_tutorials'),
-     url(r'add/', views.NewTutorial.as_view(), name='add_tutorial'),
+     url(r'add/', views.CreateNewTutorial.as_view(), name='add_tutorial'),
      url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tutorial'),
+     url(r'(?P<tutorial_id>[\w\-]+)/delete/', views.DeleteTutorial.as_view(), name='delete_tutorial'),
  
      # This must be last, otherwise it will match anything
      url(r'^(?P<tutorial_id>[\w\-]+)/$', views.TutorialDetail.as_view(), name='detail_tutorial'),
  ]
Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials
## Code Before:
from django.conf.urls import include, url

from tutorials import views

urlpatterns = [
    url(r'^$', views.ListTutorials.as_view()),
    url(r'add/', views.NewTutorial.as_view(), name='add_tutorial'),
    url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tutorial'),

    # This must be last, otherwise it will match anything
    url(r'^(?P<tutorial_id>[\w\-]+)/$', views.TutorialDetail.as_view(), name='detail_tutorial'),
]
## Instruction:
Add url name to ListView, New url for delete view, Refactor ViewClass name for NewTutorials to CreateNewTutorials
## Code After:
from django.conf.urls import include, url

from tutorials import views

urlpatterns = [
    url(r'^$', views.ListTutorials.as_view(), name='list_tutorials'),
    url(r'add/', views.CreateNewTutorial.as_view(), name='add_tutorial'),
    url(r'(?P<tutorial_id>[\w\-]+)/edit/', views.EditTutorials.as_view(), name='edit_tutorial'),
    url(r'(?P<tutorial_id>[\w\-]+)/delete/', views.DeleteTutorial.as_view(), name='delete_tutorial'),

    # This must be last, otherwise it will match anything
    url(r'^(?P<tutorial_id>[\w\-]+)/$', views.TutorialDetail.as_view(), name='detail_tutorial'),
]