from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^location$',views.location, name='location'),
]

from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^locations/?(?P<id>[0-9]+)?$',views.location, name='location'),
]

Add id parameter to URL
Add id parameter to URL

  from django.conf.urls import url
  
  from . import views
  
  urlpatterns = [
      url(r'^$', views.index, name='index'),
-     url(r'^location$',views.location, name='location'),
+     url(r'^locations/?(?P<id>[0-9]+)?$',views.location, name='location'),
  ]
  
Add id parameter to URL
## Code Before:
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^location$',views.location, name='location'),
]

## Instruction:
Add id parameter to URL
## Code After:
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^locations/?(?P<id>[0-9]+)?$',views.location, name='location'),
]
