4👍
You don’t have to create a custom class for this. You just need to create a directory with the name drf-yasg
under new or existing app and then place a file with the name swagger-ui.html
underneath it with your custom template. For example, if you already have an app with the name api
, you can just put it under api/templates/drf-yasg/swagger-ui.html
. Make sure the app api
is specified before drf-yasg
in INSTALLED_APPS.
Reference: https://github.com/axnsan12/drf-yasg/issues/294#issuecomment-464461773
Source:stackexchange.com