【发布时间】:2017-03-03 07:11:34
【问题描述】:
所以我安装了 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)
]
我不断收到以下错误,
文件“.../local/lib/python2.7/site-packages/django_filters/rest_framework/backends.py”,第 97 行,在 get_schema_fields assert compat.coreapi 不是 None,'必须安装 coreapi 才能使用
get_schema_fields()' AssertionError:必须安装coreapi才能使用get_schema_fields()
我安装了以下软件包:
- coreapi==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',...
【问题讨论】:
-
在 settings.py 中显示
INSTALLED_APPS
标签: python django django-rest-framework core-api