django url template code example

Example 1: django url tag

{% url 'some-url-name' v1 v2 %}

Example 2: django include

# import include
from django.urls import include, path

urlpatterns = [
    path('index/', views.index, name='main-view'),
    path('bio/<username>/', views.bio, name='bio'),
    path('articles/<slug:title>/', views.article, name='article-detail'),
    path('articles/<slug:title>/<int:section>/', views.section, name='article-section'),
    path('weblog/', include('blog.urls')),
    ...
]

Example 3: django url template

Django URL Mapping