Drf_yasg openapi swagger продолжает показывать ссылку на вход в Django
settings.py
INSTALLED_APPS = [
..
'drf_yasg',
..
]
views.py
class myapi(APIView):
permission_classes = (permissions.AllowAny,)
authentication_classes = ()
@swagger_auto_schema(operation_description="A custom description",
request_body=openapi.Schema(
type=openapi.TYPE_OBJECT,
properties={
'token': openapi.Schema(type=openapi.TYPE_STRING, description='token'),
},
required=['token'],
))
urls.py
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from rest_framework import permissions
schema_view = get_schema_view(
openapi.Info(
title="MY API",
default_version='v1',
),
public=True,
permission_classes=(permissions.AllowAny,),
)
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('user_api.urls')),
re_path(r'^apidoc/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]
https://gist.github.com/axilaris/2e15f9c0cc8aff2727c39917123d25f4
конфигурацияnginx
server {
listen 80;
server_name 182.20.4.110 mydomain.io;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/ubuntu/myproj_app/static/;
}
location / {
alias /home/ubuntu/myproj_app/frontend/build/;
}
location /apidoc {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
sudo tail -f /var/log/nginx/error.log
2024/04/01 12:37:01 [error] 3618#3618: *128 open() "/home/ubuntu/myproj_app/static/static/drf-yasg/insQ.min.js" failed (13: Permission denied), client: 172.20.1.172, server: 182.20.4.110, request: "GET /static/drf-yasg/insQ.min.js HTTP/1.1", host: "mydomain.io", referrer: "https://mydomain.io/apidoc/"
2024/04/01 12:37:01 [error] 3618#3618: *129 open() "/home/ubuntu/myproj_app/static/static/drf-yasg/immutable.min.js" failed (13: Permission denied), client: 172.20.1.172, server: 182.20.4.110, request: "GET /static/drf-yasg/immutable.min.js HTTP/1.1", host: "mydomain.io", referrer: "https://mydomain.io/apidoc/"
2024/04/01 12:37:01 [error] 3618#3618: *128 open() "/home/ubuntu/myproj_app/static/static/drf-yasg/swagger-ui-dist/favicon-32x32.png" failed (13: Permission denied), client: 172.20.1.172, server: 182.20.4.110, request: "GET /static/drf-yasg/swagger-ui-dist/favicon-32x32.png HTTP/1.1", host: "mydomain.io", referrer: "https://mydomain.io/apidoc/"
Однако я продолжаю получать это, когда захожу в https://mydomain.io/apidoc/. Это должна быть страница swagger api. У меня все работает в среде разработки на mac, но не работает на ubuntu 22.04