recamshak / django-debug-panel

django-debug-toolbar in WebKit DevTools. Works fine with background Ajax requests and non-HTML responses.
BSD 3-Clause "New" or "Revised" License
404 stars 69 forks source link

fix: debug-panel not work by use rest_framework.schemas.get_schema_view #39

Closed shane965 closed 2 years ago

shane965 commented 4 years ago

I use get_schema_view eg: from rest_framework.schemas import get_schema_view schema_view = get_schema_view(title='Foo', renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer], public=True, url='/foo/') On Swagger UI , request url like /foo/xxx/xxx , docs url like /foo/docs If use django debug panel, not work Django log : Not Found: /foo/debug/data/1578554723.038458/ Because rest_framework.schemas auto add prefix /foo , /foo/debug/data/ mismatch r'^%s/data/(?P\d+.\d+)/$' I try r'%s/data/(?P\d+.\d+)/$' replace r'^%s/data/(?P\d+.\d+)/$' Bug fix. Maybe all versions will be affected.

Version: python2.7 ubuntu18.04 django(1.11.1) django-rest-swagger (2.1.2) djangorestframework (3.9.4) django-debug-panel (0.8.3) django-debug-toolbar (1.11)

Thank for u work , django-debug-panel helped me a lot