Skip to content

Commit f70b997

Browse files
committed
update urls to 2.1
1 parent cdc4e0a commit f70b997

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

gettingstarted/urls.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
from django.conf.urls import include, url
2-
from django.urls import path
1+
from django.urls import path, include
32

43
from django.contrib import admin
54

65
admin.autodiscover()
76

87
import hello.views
98

10-
# Examples:
11-
# url(r'^$', 'gettingstarted.views.home', name='home'),
12-
# url(r'^blog/', include('blog.urls')),
9+
# To add a new path, first import the app:
10+
# import blog
11+
#
12+
# Then add the new path:
13+
# path('blog/', blog.urls, name="blog")
14+
#
15+
# Learn more here: https://docs.djangoproject.com/en/2.1/topics/http/urls/
1316

1417
urlpatterns = [
15-
url(r"^$", hello.views.index, name="index"),
16-
url(r"^db", hello.views.db, name="db"),
18+
path("", hello.views.index, name="index"),
19+
path("db/", hello.views.db, name="db"),
1720
path("admin/", admin.site.urls),
1821
]

0 commit comments

Comments
 (0)