Reputation: 21
I'm using drf-yasg to add swagger auto schema to my endpoints. The swagger-ui is being visible at /api/v1/swagger/ At my local setup this link is working fine and I'm getting the proper schema as required.
/api/v1/swagger at my local setup
But while accessing the same link when my application is deployed at the server, It is showing a "django login" hyperlink as:
And this "django login" hyperlink is navigating to -> SERVER_IP/accounts/login/?next=/api/v1/swagger/ which is showing 404 Not found page as: 404 Not found page after clicking on django login hyperlink
Even though the openAPI yaml file is being successfully generated of the endpoints at server, but the UI is not getting visible.
There was one similar question at stackoverflow: Similar question at SO, but the solution mentioned there was not working for me.
Thanks.
Upvotes: 2
Views: 1205
Reputation: 3457
May you need to set USE_SESSION_AUTH
to False in SWAGGER_SETTINGS
in settings.py file.
# Swagger settings
SWAGGER_SETTINGS = {
'USE_SESSION_AUTH': False
}
Hope it could help.
Upvotes: 0