i am using this package rest framework and its working fine and i installed the packge and added that to installed packages and here is what i changed in my url.py :
from django.contrib import admin
from django.urls import include, path
from rest_framework import routers
from django.shortcuts import redirect
from tutorial.quickstart import views
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
SchemaView = get_schema_view(
openapi.Info(
title="asdasdsad",
default_version='v1',
),
public=False,
permission_classes=(permissions.AllowAny,)
)
swagger_info = openapi.Info(
title="Snippets API",
default_version='v1',
description="""This is a demo project for the [drf-yasg](https://github.com/axnsan12/drf-yasg) Django Rest Framework library.
The `swagger-ui` view can be found [here](/cached/swagger).
The `ReDoc` view can be found [here](/cached/redoc).
The swagger YAML document can be found [here](/cached/swagger.yaml).
You can log in using the pre-existing `admin` user with password `passwordadmin`.""", # noqa
terms_of_service="https://www.google.com/policies/terms/",
contact=openapi.Contact(email="contact@snippets.local"),
license=openapi.License(name="BSD License"),
)
SchemaView = get_schema_view(
validators=['ssv', 'flex'],
public=True,
permission_classes=(permissions.AllowAny,),
)
i am using this package rest framework and its working fine and i installed the packge and added that to installed packages and here is what i changed in my url.py :
and in the end i use paths like below :
now when i run python manage.py runserver and when i navigate to localhost:8000/swagger i get this error :