Skip to content

Commit 6c9d8cf

Browse files
author
Juan Benitez
committed
change url to path on routes urls
1 parent b94fd13 commit 6c9d8cf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

movies/urls.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
from django.conf.urls import url
1+
from django.urls import include, path, re_path
22
from . import views
33

44

55
urlpatterns = [
6-
url(r'^api/v1/movies/(?P<pk>[0-9]+)$', # urls with details i.e /movies/(1-9)
6+
re_path(r'^api/v1/movies/(?P<pk>[0-9]+)$', # Url to get update or delete a movie
77
views.get_delete_update_movie.as_view(),
88
name='get_delete_update_movie'
99
),
10-
url(
11-
r'^api/v1/movies/$', # urls list all and create new one
10+
path('api/v1/movies/', # urls list all and create new one
1211
views.get_post_movies.as_view(),
1312
name='get_post_movies'
1413
)

0 commit comments

Comments
 (0)