File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
- from django .conf .urls import include , url
2
- from django .urls import path
1
+ from django .urls import path , include
3
2
4
3
from django .contrib import admin
5
4
6
5
admin .autodiscover ()
7
6
8
7
import hello .views
9
8
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/
13
16
14
17
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" ),
17
20
path ("admin/" , admin .site .urls ),
18
21
]
You can’t perform that action at this time.
0 commit comments