@@ -54,3 +54,37 @@ if settings.USE_DEBUG_TOOLBAR:
5454
5555 ] + urlpatterns
5656```
57+
58+
59+ ## Example 2 from heritagesites
60+ [ heritagesites] ( https://github.com/Michael-Cantley/heritagesites ) is a
61+ [ Django] ( /django.html ) web application with a [ MySQL] ( /mysql.html )
62+ backend that displays
63+ [ UNESCO heritage sites] ( https://whc.unesco.org/en/list/ ) . The project
64+ code is open source under the
65+ [ MIT license] ( https://github.com/Michael-Cantley/heritagesites/blob/master/LICENSE ) .
66+
67+ [ ** heritagesites/heritagesites/urls.py** ] ( https://github.com/Michael-Cantley/heritagesites/blob/master/heritagesites/urls.py )
68+
69+ ``` python
70+ # urls.py
71+ ~~ from django.urls import path, re_path
72+ from . import views
73+
74+
75+ urlpatterns = [
76+ ~~ path(' ' , views.HomePageView.as_view(), name = ' home' ),
77+ ~~ path(' about/' , views.AboutPageView.as_view(), name = ' about' ),
78+ ~~ path(' countries/' , views.CountryAreaListView.as_view(), name = ' country_area' ),
79+ ~~ path(' countries/<int:pk>/' , views.CountryAreaDetailView.as_view(),
80+ name = ' country_area_detail' ),
81+ ~~ path(' sites/' , views.SiteListView.as_view(), name = ' sites' ),
82+ ~~ path(' sites/<int:pk>/' , views.SiteDetailView.as_view(), name = ' site_detail' ),
83+
84+ ~~ path(' sites/new/' , views.SiteCreateView.as_view(), name = ' site_new' ),
85+ ~~ path(' sites/<int:pk>/delete/' , views.SiteDeleteView.as_view(), name = ' site_delete' ),
86+ ~~ path(' sites/<int:pk>/update/' , views.SiteUpdateView.as_view(), name = ' site_update' ),
87+
88+ ~~ path(' sites/search' , views.SiteFilterView.as_view(), name = " search" )
89+ ]
90+ ```
0 commit comments