Opened 5 years ago
Closed 5 years ago
#31652 closed Uncategorized (invalid)
Admin site URLS do not respect APPEND_SLASH conf
| Reported by: | Emmanuel Nosa E. | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | 3.0 |
| Severity: | Normal | Keywords: | append, slash, APPEND_SLASH, urls, admin |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
If this is a design decision, then this ticket can be gracefully closed.
Description
Using the APPEND_SLASH setting, one would expect and does receive the intended behaviour from the configured urls, but to my notice, the admin urls are not respecting this, they append a slash to the end of the url regardless.
Reason
Over here in the django source code (https://github.com/django/django/blob/master/django/contrib/admin/sites.py) for django.contrib.admin.sites, every url within the urlpatterns of the AdminSite.get_urls() ends with a trailing slash. As seen here:
- https://github.com/django/django/blob/master/django/contrib/admin/sites.py#L256
- https://github.com/django/django/blob/master/django/contrib/admin/sites.py#L287
I simply suggest that the APPEND_SLASH setting is respected and the intended urls are returned. In as much as this doesn't hurt, it's an issue within the system, unless like i said earlier;
maybe it's a design decision.
Change History (2)
comment:1 by , 5 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 5 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Please read carefully
APPEND_SLASHdocs, this setting doesn't affect configured URLs, see alsoCommonMiddlewaredocs for more details.Use one of support channels if you have further questions.