7.7. Views URLs
7.7.1. Global URLs
7.7.2. In app URLs
7.7.3. urlpatterns
# doctest: +SKIP_FILE
from django.conf import settings
from django.contrib import admin
from django.urls import path
from django.urls import include
import debug_toolbar
urlpatterns = [
path('admin/', admin.site.urls),
path('contact/', include(('contact.urls', 'contact'), namespace='contact')),
]
if settings.DEBUG:
urlpatterns += [
path('__debug__/', include(debug_toolbar.urls)),
]
7.7.4. path
# doctest: +SKIP_FILE
from django.urls import path
from shop.views import ListView, DetailView
urlpatterns = [
path('<int:id>/', DetailView.as_view(), name='details'),
path('', ListView.as_view(), name='list'),
]
7.7.5. url
7.7.6. include