  from django.core.management.base import BaseCommand
  
  from rest_framework.compat import coreapi
  from rest_framework.renderers import (
      CoreJSONRenderer, JSONOpenAPIRenderer, OpenAPIRenderer
  )
  from rest_framework.schemas.generators import SchemaGenerator
  
  
  class Command(BaseCommand):
      help = "Generates configured API schema for project."
  
 
</s> remove from rest_framework.compat import (
    URLPattern, URLResolver, coreapi, coreschema, get_original_route
)
 </s> add from rest_framework.compat import URLPattern, URLResolver, get_original_route </s> remove         parser.add_argument('--title', dest="title", default=None, type=str)
 </s> add         parser.add_argument('--title', dest="title", default='', type=str) </s> remove from .generators import SchemaGenerator
from .inspectors import AutoSchema, DefaultSchema, ManualSchema  # noqa
 </s> add from . import coreapi, openapi
from .inspectors import DefaultSchema  # noqa
from .coreapi import AutoSchema, ManualSchema, SchemaGenerator  # noqa
from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi'
  from django.core.management.base import BaseCommand
  
from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi'
from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi'
from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi'
from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi'
from rest_framework import renderers
from rest_framework.schemas import coreapi
from rest_framework.schemas.openapi import SchemaGenerator

OPENAPI_MODE = 'openapi'
COREAPI_MODE = 'coreapi'
  
  
  class Command(BaseCommand):
      help = "Generates configured API schema for project."
  
keep keep replace replace replace replace replace keep keep keep keep keep
 Added OpenAPI Schema Generation. (#6532)

Co-authored-by: Lucidiot <lucidiot@protonmail.com>
Co-authored-by: dongfangtianyu <dongfangtianyu@qq.com> 
rest_framework/management/commands/generateschema.py