Day 69-72 Django Rest Framework Swagger error
Closed this issue · 3 comments
Joeriksson commented
After coding along the videos in this section of the course. I get a
'AutoSchema' object has no attribute 'get_link'
error when going to api/docs.
It turns out you need to put the following into settings.py to get it to work
REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'
}
Reference: https://www.django-rest-framework.org/community/3.10-announcement/#continuing-to-use-coreapi
It's probably because I am using a newer version of django-rest-framework than is used in the videos?
bbelderbos commented
Thanks for pointing this out @Joeriksson, I reproduced and fixed it as per above: 1aabe58
alex-vegan commented
@Joeriksson, thanks for that. You've saved my time and nerves for find release of this issue.
Joeriksson commented
@alex-vegan glad it helped!