Review and streamline URL structure #393

Closed
opened 2021-03-02 20:12:54 +01:00 by hansegucker · 8 comments
Owner
e.g. https://docs.djangoproject.com/en/dev/misc/design-philosophies/#definitive-urls To be done in all apps.
Owner

I cannot find any hints why all URLs should end with a / in the linked documentation. Why do you think this is necessary, or even correct?

I cannot find any hints why all URLs should end with a `/` in the linked documentation. Why do you think this is necessary, or even correct?
Member

In Django (if you use the default settings) example.com/foo will redirect (and thus be equal) to example.com/foo/. This is however not the other way around. These notations don't differ that much, so we shouldn't separate between them in my opinion. To add to this, I think URLs ending with a / are more beautiful.

In Django (if you use the default settings) `example.com/foo` will redirect (and thus be equal) to `example.com/foo/`. This is however not the other way around. These notations don't differ that much, so we shouldn't separate between them in my opinion. To add to this, I think URLs ending with a `/` are more beautiful.
Owner

Apart from what you consider beautiful, there is no technial reason. Django, with default setting for APPEND_SLASHES, will redirect to %s/ if %s is not found; no more, no less. This situation only happens when you use hard-coded URLs, or manually open a URL that does not exist and forget the trailing /. Even then, it does not matter — the only point where it matters is SEO (which the docs also point out explicitly). In the case where URLs are only called through links in the app, with URLs generated by reverse-mapping, nothing ever happens that has to do with it. Thus, this is exclusively a cosmetic issue.

Also, ending with a slash is only correct for collections (i.e. URL namespaces that have sub-URLs for single objects, etc.), not for leaf URLs, imho.

Dropping from the milestone and tagging refactoring/non-technical.

Apart from what you consider beautiful, there is no technial reason. Django, with default setting for `APPEND_SLASHES`, will redirect to `%s/` if `%s` is not found; no more, no less. This situation only happens when you use hard-coded URLs, or manually open a URL that does not exist and forget the trailing `/`. Even then, it does not matter — the only point where it matters is SEO (which the docs also point out explicitly). In the case where URLs are only called through links in the app, with URLs generated by reverse-mapping, nothing ever happens that has to do with it. Thus, this is exclusively a cosmetic issue. Also, ending with a slash is only correct for collections (i.e. URL namespaces that have sub-URLs for single objects, etc.), not for leaf URLs, imho. Dropping from the milestone and tagging refactoring/non-technical.
Owner

In other words, convince me that this is a technical issue concerning our upcoming release.

In other words, convince me that this is a technical issue concerning our upcoming release.
Author
Owner

This issue is not very important for me, but I would like it if the structure of all URLs is consistent. So, removing the milestone is OK for me.

This issue is not very important for me, but I would like it if the structure of all URLs is consistent. So, removing the milestone is OK for me.
Owner

changed title from {-Let all URLs end with a slash-} to {+Review and streamline URL structure+}

changed title from **{-Let all URLs end with a slash-}** to **{+Review and streamline URL structure+}**
Owner

changed the description

changed the description
Owner

Obsoleted by #696

Obsoleted by #696
nik closed this issue 2022-07-26 13:28:14 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aleksis/AlekSIS-Core#393
No description provided.