Search code examples
pythondjangodjango-urls

What is the "path" mean in Django urls


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.


Solution

  • 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.