Use numeric identifiers in all URLs #4599

Closed
opened 2025-12-29 18:38:06 +01:00 by adam · 3 comments
Owner

Originally created by @jeremystretch on GitHub (Feb 25, 2021).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Replace the usage of slugs in URLs with numeric IDs. For example, for a site with the ID 123 and slug 'site-a', the URL would change from

/dcim/sites/site-a/

to

/dcim/sites/123/

All child views (edit, import, etc.) would change as well.

Justification

  1. Provides a more consistent URL pattern, where all objects are identified the same way.
  2. Allows us to phase out the use of slug fields.
Originally created by @jeremystretch on GitHub (Feb 25, 2021). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Replace the usage of slugs in URLs with numeric IDs. For example, for a site with the ID 123 and slug 'site-a', the URL would change from `/dcim/sites/site-a/` to `/dcim/sites/123/` All child views (edit, import, etc.) would change as well. ### Justification 1. Provides a more consistent URL pattern, where all objects are identified the same way. 2. Allows us to phase out the use of slug fields.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 18:38:06 +01:00
adam closed this issue 2025-12-29 18:38:07 +01:00
Author
Owner

@ryanmerolle commented on GitHub (Feb 25, 2021):

Having slugs is nice in the url, but plenty of other tools because of consistency and other challenges of trying to keep slugs in the url path. LibreNMS comes to mind here. Most of the benefits of slugs in a url with regards to external integrations can be solved with other means.

If it greatly helps out on the backend & development I think its fair to do.

@ryanmerolle commented on GitHub (Feb 25, 2021): Having slugs is nice in the url, but plenty of other tools because of consistency and other challenges of trying to keep slugs in the url path. LibreNMS comes to mind here. Most of the benefits of slugs in a url with regards to external integrations can be solved with other means. If it greatly helps out on the backend & development I think its fair to do.
Author
Owner

@jpobeda commented on GitHub (Feb 25, 2021):

I agree. I like the slugs as well but consistency is always favored.

@jpobeda commented on GitHub (Feb 25, 2021): I agree. I like the slugs as well but consistency is always favored.
Author
Owner

@jeremystretch commented on GitHub (Feb 26, 2021):

Well, that was easy. 🙂

@jeremystretch commented on GitHub (Feb 26, 2021): Well, that was easy. :slightly_smiling_face:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4599