You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For instance, if the site is hosted at www.example.com/example rather than www.example.com, the logging modifications applied with no_logging do not work. The cause is at line 181 of middleware.py in the _get_func method. It uses request.path for fetching the corresponding view. According to the Django documentation, request.path has the full path, including the prefix, which causes the URL resolver to come up empty due to the unexpected prefix. Instead, it should use request.path_info, which strips away the prefix and leaves only the portion of the path actually used to resolve URLs. I have tested it, and this change fixes the issue. I can submit a pull request if desired.
The text was updated successfully, but these errors were encountered:
For instance, if the site is hosted at www.example.com/example rather than www.example.com, the logging modifications applied with no_logging do not work. The cause is at line 181 of middleware.py in the _get_func method. It uses
request.path
for fetching the corresponding view. According to the Django documentation,request.path
has the full path, including the prefix, which causes the URL resolver to come up empty due to the unexpected prefix. Instead, it should userequest.path_info
, which strips away the prefix and leaves only the portion of the path actually used to resolve URLs. I have tested it, and this change fixes the issue. I can submit a pull request if desired.The text was updated successfully, but these errors were encountered: