Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The no_logging decorator does not work when the root URL for the site is a subpath instead of the host #147

Open
BurningLights opened this issue Apr 13, 2022 · 0 comments

Comments

@BurningLights
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant