from django.conf.urls import url

from . import views

app_name = 'places'
urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'^(?P<slug>[-\w]+)/$', views.PlaceView.as_view(), name='place'),
]

from django.urls import include, path

from . import views

app_name = 'places'
urlpatterns = [
    path('', views.IndexView.as_view(), name='index'),
    path('<slug:slug>/', views.PlaceView.as_view(), name='place'),
]

Move places urlpatterns to Django 2.0 preferred method
Move places urlpatterns to Django 2.0 preferred method

- from django.conf.urls import url
+ from django.urls import include, path
  
  from . import views
  
  app_name = 'places'
  urlpatterns = [
-     url(r'^$', views.IndexView.as_view(), name='index'),
+     path('', views.IndexView.as_view(), name='index'),
-     url(r'^(?P<slug>[-\w]+)/$', views.PlaceView.as_view(), name='place'),
+     path('<slug:slug>/', views.PlaceView.as_view(), name='place'),
  ]
  
Move places urlpatterns to Django 2.0 preferred method
## Code Before:
from django.conf.urls import url

from . import views

app_name = 'places'
urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'^(?P<slug>[-\w]+)/$', views.PlaceView.as_view(), name='place'),
]

## Instruction:
Move places urlpatterns to Django 2.0 preferred method
## Code After:
from django.urls import include, path

from . import views

app_name = 'places'
urlpatterns = [
    path('', views.IndexView.as_view(), name='index'),
    path('<slug:slug>/', views.PlaceView.as_view(), name='place'),
]
