mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2025-06-28 16:25:44 +08:00
Fixed subject serializer and added drf-yasg for better endpoint documentation
This commit is contained in:
parent
a33b32436d
commit
c955cadc18
6 changed files with 117 additions and 14 deletions
|
@ -76,6 +76,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'drf_yasg',
|
||||
'django.contrib.gis',
|
||||
'rest_framework',
|
||||
'rest_framework_simplejwt',
|
||||
|
|
|
@ -18,8 +18,30 @@ from django.contrib import admin
|
|||
from django.urls import path, include
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.urls import re_path
|
||||
from rest_framework import permissions
|
||||
from drf_yasg.views import get_schema_view
|
||||
from drf_yasg import openapi
|
||||
|
||||
schema_view = get_schema_view(
|
||||
openapi.Info(
|
||||
title="StudE API",
|
||||
default_version='v1',
|
||||
description="StudE Endpoints",
|
||||
terms_of_service="https://www.google.com/policies/terms/",
|
||||
contact=openapi.Contact(email="noehbernasol0@gmail.com"),
|
||||
),
|
||||
public=True,
|
||||
permission_classes=(permissions.AllowAny,),
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('api/v1/', include('api.urls'))
|
||||
path('api/v1/', include('api.urls')),
|
||||
path('swagger<format>/', schema_view.without_ui(cache_timeout=0),
|
||||
name='schema-json'),
|
||||
path('swagger/', schema_view.with_ui('swagger',
|
||||
cache_timeout=0), name='schema-swagger-ui'),
|
||||
path('redoc/', schema_view.with_ui('redoc',
|
||||
cache_timeout=0), name='schema-redoc'),
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue