About URL Path vs. Query Parameters

When in doubt whether to use URL path or query parameters, follow this rule:

  • Use URL path to uniquely define resources: list views, detail views, form views.

    /jobs/
    /blog/2022/02/hello-world/
    /contact/
    
  • Use query parameters to define how the resource is displayed: item list or item grid, page 1 or page 10, web view or print view.

    /profiles/?show=grid
    /profiles/?page=10
    /profiles/?media=print
    

Tips and Tricks Web Design Architecture Django 5.x Django 4.2 Django 3.2