File: non_public_urls.py

package info (click to toggle)
drf-yasg-nonfree 1.21.10-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 15,784 kB
  • sloc: javascript: 6,247; python: 5,073; makefile: 31; sh: 13
file content (18 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django.urls import include, path
from rest_framework import permissions

import testproj.urls
from drf_yasg import openapi
from drf_yasg.views import get_schema_view

view = get_schema_view(
    openapi.Info('bla', 'ble'),
    public=False,
    permission_classes=(permissions.AllowAny,)
)
view = view.without_ui(cache_timeout=None)

urlpatterns = [
    path('', include(testproj.urls)),
    path('private/swagger.yaml', view, name='schema-private'),
]