django-silk
django-silk copied to clipboard
SILKY_IGNORE_PATHS should ignore path without SCRIPT_NAME path prefix
The settings.SILKY_IGNORE_PATHS
(undocumented) config ignore paths
https://github.com/jazzband/django-silk/blob/4418b29d23bff2a34edb4310a6472dcf2805eb83/silk/middleware.py#L47
If specified settings.SILKY_IGNORE_PATHS
(undocumented) matches the request.path
exactly, it will be excluded from recording. However, since it uses request.path
as the matching condition, the path will have the path prefix passed from the web front server (apache/nginx). This may or may not match depending on the web front server configuration.
I think django-silk should use request.path_info
to avoid this problem.
https://docs.djangoproject.com/en/2.2/ref/request-response/#django.http.HttpRequest.path_info
Yes that is indeed an issue, @shimizukawa did you find any possible solution?
I think a simple solution would be to change the ignore condition. In my case, I want to ignore all paths that contain admin
string.
ignored = any(path in request.path for path in config.SILKY_IGNORE_PATHS)