What is the "path" mean in Django urls

11,123

Solution 1

path() is from the new URL syntax, which was added in Django 2.0.

You can find out more information in the tutorial or url docs, as long as you have Django 2.0 or later selected on the documentation site.

Solution 2

path() Function Returns an element for inclusion in urlpatterns with 4 args: Two required route and view and two are optional kwargs and name

path(route, view, kwargs=None, name=None)

Share:
11,123
Vladyslav
Author by

Vladyslav

Working for food

Updated on June 15, 2022

Comments

  • Vladyslav
    Vladyslav about 2 hours

    When a read some new project on Django in one of urls.py files i find following code:

    from django.urls import path
    from . import views
    
    urlpatterns = [
        path('buyers/embed/<int:id>/view', views.buyers_view),
    ]
    

    This is written in application that not used for now (Instead of this is used another application for buyers view). But i want to know what is this path.

    I can't find any information about it in documentation. Maybe this is some old style for url routing, or some mistakes.

    Thanks for any help.