|
@@ -1,6 +1,7 @@
|
|
|
from django.conf import settings
|
|
from django.conf import settings
|
|
|
from django.conf.urls import include
|
|
from django.conf.urls import include
|
|
|
from django.urls import path
|
|
from django.urls import path
|
|
|
|
|
+from django.views.decorators.cache import cache_page
|
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
from django.views.decorators.csrf import csrf_exempt
|
|
|
from django.views.static import serve
|
|
from django.views.static import serve
|
|
|
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
|
|
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
|
|
@@ -56,7 +57,13 @@ _patterns = [
|
|
|
path('api/wireless/', include('wireless.api.urls')),
|
|
path('api/wireless/', include('wireless.api.urls')),
|
|
|
path('api/status/', StatusView.as_view(), name='api-status'),
|
|
path('api/status/', StatusView.as_view(), name='api-status'),
|
|
|
|
|
|
|
|
- path('api/schema/', SpectacularAPIView.as_view(), name='schema'),
|
|
|
|
|
|
|
+ path(
|
|
|
|
|
+ "api/schema/",
|
|
|
|
|
+ cache_page(timeout=86400, key_prefix=f"api_schema_{settings.VERSION}")(
|
|
|
|
|
+ SpectacularAPIView.as_view()
|
|
|
|
|
+ ),
|
|
|
|
|
+ name="schema",
|
|
|
|
|
+ ),
|
|
|
path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='api_docs'),
|
|
path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='api_docs'),
|
|
|
path('api/schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='api_redocs'),
|
|
path('api/schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='api_redocs'),
|
|
|
|
|
|