gpt4 book ai didi

python - 必须安装 coreapi 才能使用 'get_schema_fields()'

转载 作者:太空狗 更新时间:2023-10-30 01:20:22 25 4
gpt4 key购买 nike

所以我安装了 django-rest-swagger,如 django rest documentation 所示.

继续

from django.conf.urls import url
from rest_framework_swagger.views import get_swagger_view

schema_view = get_swagger_view(title='Pastebin API')

urlpatterns = [
url(r'^$', schema_view)
]

我不断收到以下错误,

File ".../local/lib/python2.7/site-packages/django_filters/rest_framework/backends.py", line 97, in get_schema_fields assert compat.coreapi is not None, 'coreapi must be installed to use get_schema_fields()' AssertionError: coreapi must be installed to use get_schema_fields()

我安装了以下软件包:

  • 核心接口(interface)==2.0.8
  • Django==1.9.6
  • django-filter==0.15.3
  • django-rest-swagger==2.0.7
  • djangorestframework==3.5.0

编辑:

已安装的应用:

  • 'rest_framework',
  • 'rest_framework_swagger', ...

最佳答案

尝试安装 coreapi,这对我有用

pip install coreapi pyyaml

关于python - 必须安装 coreapi 才能使用 'get_schema_fields()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40168762/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com