[Django] #34694: trailing slash is not appending

83 views
Skip to first unread message

Django

unread,
Jul 3, 2023, 6:23:09 PM7/3/23
to django-...@googlegroups.com
#34694: trailing slash is not appending
---------------------------------------+--------------------------------
Reporter: davidhdpro | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: 4.2
Severity: Normal | Keywords: trailing slash
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+--------------------------------
Up to version 4.1.9 all is good,
but with 4.2 and higher if there is no slash in the end of URL - 404
returned
Slash not being appended even though CommonMiddleware is set in
settings.py and APPEND_SLASH = True has no effect too

--
Ticket URL: <https://code.djangoproject.com/ticket/34694>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 3, 2023, 11:32:36 PM7/3/23
to django-...@googlegroups.com
#34694: trailing slash is not appending
--------------------------------+--------------------------------------
Reporter: davidhdpro | Owner: nobody
Type: Bug | Status: closed

Component: Core (URLs) | Version: 4.2
Severity: Normal | Resolution: worksforme

Keywords: trailing slash | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => worksforme


Comment:

Thanks for the report, however it works for me. Please use one of
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels] where folks will help you debug your issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/34694#comment:1>

Django

unread,
Nov 1, 2023, 1:40:31 PM11/1/23
to django-...@googlegroups.com
#34694: trailing slash is not appending
--------------------------------+--------------------------------------
Reporter: davidhdpro | Owner: nobody
Type: Bug | Status: closed
Component: Core (URLs) | Version: 4.2
Severity: Normal | Resolution: worksforme
Keywords: trailing slash | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by iamsobanjaved):

I am also facing this issue. Not appearing on dev env but facing this on
production and staging instance.

{{{

[2023-11-01 17:31:26 +0000] [22] [INFO] GET /heartbeat
[2023-11-01 17:31:26 +0000] [22] [ERROR] Error handling request /heartbeat
Traceback (most recent call last):
File "/edx/app/venvs/venv/lib/python3.8/site-
packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/edx/app/venvs/venv/lib/python3.8/site-
packages/django/core/handlers/base.py", line 181, in _get_response
callback, callback_args, callback_kwargs =
self.resolve_request(request)
File "/edx/app/venvs/venv/lib/python3.8/site-
packages/django/core/handlers/base.py", line 313, in resolve_request
resolver_match = resolver.resolve(request.path_info)
File "/edx/app/venvs/venv/lib/python3.8/site-
packages/newrelic/hooks/framework_django.py", line 605, in wrapper
return _wrapped(*args, **kwargs)
File "/edx/app/venvs/venv/lib/python3.8/site-
packages/newrelic/hooks/framework_django.py", line 593, in _wrapped
result = wrapped(path)
File "/edx/app/venvs/venv/lib/python3.8/site-
packages/django/urls/resolvers.py", line 702, in resolve
raise Resolver404({"tried": tried, "path": new_path})
django.urls.exceptions.Resolver404: {'tried': [[<URLPattern 'heartbeat/'
[name='heartbeat']>], 'path': 'heartbeat'}
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34694#comment:2>

Django

unread,
Nov 1, 2023, 1:41:06 PM11/1/23
to django-...@googlegroups.com
#34694: trailing slash is not appending
--------------------------------+--------------------------------------
Reporter: davidhdpro | Owner: nobody
Type: Bug | Status: new

Component: Core (URLs) | Version: 4.2
Severity: Normal | Resolution:
Keywords: trailing slash | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by iamsobanjaved):

* status: closed => new
* resolution: worksforme =>


--
Ticket URL: <https://code.djangoproject.com/ticket/34694#comment:3>

Django

unread,
Nov 1, 2023, 2:44:01 PM11/1/23
to django-...@googlegroups.com
#34694: trailing slash is not appending
--------------------------------+--------------------------------------
Reporter: davidhdpro | Owner: nobody
Type: Bug | Status: closed

Component: Core (URLs) | Version: 4.2
Severity: Normal | Resolution: worksforme

Keywords: trailing slash | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* status: new => closed
* resolution: => worksforme


Comment:

Hello, thanks for your interest in making Django better.

As before, I can't reproduce your issue, but a quick search on the
internet returned this result that may be useful for you:
* https://stackoverflow.com/questions/76744403/django-does-not-append-
trailing-slash-automatically
* https://forum.djangoproject.com/t/urls-without-a-trailing-slash-dont-
redirect/14585

If you need further support, please refer to the
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
User Support channels] for further assistance.

Thank you!

--
Ticket URL: <https://code.djangoproject.com/ticket/34694#comment:4>

Reply all
Reply to author
Forward
0 new messages