  from rest_framework.authtoken.models import Token
  from rest_framework.authtoken.serializers import AuthTokenSerializer
  from rest_framework.response import Response
  from rest_framework.schemas import ManualSchema
  from rest_framework.views import APIView
  
  
 
</s> remove import coreapi
import coreschema
 </s> add  </s> remove import coreapi
 </s> add  </s> remove     schema = ManualSchema(
        fields=[
            coreapi.Field(
                name="username",
                required=True,
                location='form',
                schema=coreschema.String(
                    title="Username",
                    description="Valid username for authentication",
 </s> add     if coreapi is not None and coreschema is not None:
        schema = ManualSchema(
            fields=[
                coreapi.Field(
                    name="username",
                    required=True,
                    location='form',
                    schema=coreschema.String(
                        title="Username",
                        description="Valid username for authentication",
                    ), </s> remove             ),
        ],
        encoding="application/json",
    )
 </s> add             ],
            encoding="application/json",
        )
from rest_framework.compat import coreapi, coreschema
  from rest_framework.authtoken.models import Token
  from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.compat import coreapi, coreschema
  from rest_framework.response import Response
  from rest_framework.schemas import ManualSchema
  from rest_framework.views import APIView
  
  
keep add keep keep keep keep keep
 Import coreapi from rest_framework.compat, not directly. (#5921) 
rest_framework/authtoken/views.py