3.3.1 Accessing Data: Understanding Django’s Slug

When organizing data for a website, a developer should always ask how the data will be accessed and, more specifically, how the user will request these data.

A website is accessed with a URL, or Uniform Resource Locator, which identifies data held by the website. For URLs to work correctly, the resources that they identify must be uniquely identifiable. To find a resource, we must have an unambiguous method by which to refer to it. If we do not, then it becomes possible to request a URL and to end up with two or more potential resources. Can you imagine asking Amazon for a page about a movie and half of the time receiving a page about a different movie of the same name? Websites would become unusable. ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.