Skip to content

Commit d9f5418

Browse files
chrisshyicarltongibson
authored andcommitted
Update to Django 2.0 Routing Syntax (#6049)
1 parent 1a17043 commit d9f5418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/tutorial/6-viewsets-and-routers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Because we're using `ViewSet` classes rather than `View` classes, we actually do
105105

106106
Here's our re-wired `snippets/urls.py` file.
107107

108-
from django.conf.urls import url, include
108+
from django.urls import path, include
109109
from rest_framework.routers import DefaultRouter
110110
from snippets import views
111111

@@ -116,7 +116,7 @@ Here's our re-wired `snippets/urls.py` file.
116116

117117
# The API URLs are now determined automatically by the router.
118118
urlpatterns = [
119-
url(r'^', include(router.urls))
119+
path('', include(router.urls)),
120120
]
121121

122122
Registering the viewsets with the router is similar to providing a urlpattern. We include two arguments - the URL prefix for the views, and the viewset itself.

0 commit comments

Comments
 (0)