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
I have reduced the issue to the simplest possible case.
I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Steps to reproduce
Use djangorestframework==3.10.0
In urls.py:
from django.urls import path
from rest_framework.documentation import include_docs_urls
urlpatterns = [
path("docs/", include_docs_urls(title="Platinum API docs")),
]
Visit /docs/ in browser.
Expected behavior
No crash please.
Actual behavior
2019-07-19 11:41:21,446 [django.request] [ERROR] Internal Server Error: /docs/
Traceback (most recent call last):
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/views.py", line 497, in dispatch
response = self.handle_exception(exc)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/schemas/views.py", line 48, in handle_exception
return super().handle_exception(exc)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/views.py", line 457, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/views.py", line 468, in raise_uncaught_exception
raise exc
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/views.py", line 494, in dispatch
response = handler(request, *args, **kwargs)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/schemas/views.py", line 37, in get
schema = self.schema_generator.get_schema(request, self.public)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/schemas/coreapi.py", line 153, in get_schema
links = self.get_links(None if public else request)
File "/home/thnee/.pyenv/versions/lookatech-platinum/lib/python3.6/site-packages/rest_framework/schemas/coreapi.py", line 140, in get_links
link = view.schema.get_link(path, method, base_url=self.url)
AttributeError: 'AutoSchema' object has no attribute 'get_link'
2019-07-19 11:41:21,449 [django.server] [ERROR] "GET /docs/ HTTP/1.1" 500 27
The text was updated successfully, but these errors were encountered:
thnee
changed the title
Crash in include_docs_urls when upgrading from 3.9 to 3.10
Crash in include_docs_urls when upgrading from 3.9 to 3.10
Jul 19, 2019
Checklist
master
branch of Django REST framework.Steps to reproduce
Use djangorestframework==3.10.0
In
urls.py
:Visit
/docs/
in browser.Expected behavior
No crash please.
Actual behavior
The text was updated successfully, but these errors were encountered: