Coreapi must be installed to use 'get_schema_fields ()'

So, I installed django-rest-swagger as shown in the django rest documentation .

And on

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) ] 

I keep getting the following error,

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

I have the following packages installed:

  • coreapi == 2.0.8
  • Django == 1.9.6
  • Django filter == 0.15.3
  • Django-rest-swagger == 2.0.7
  • djangorestframework == 3.5.0

EDIT:

Installed applications:

  • 'rest_framework',
  • 'rest_framework_swagger', ...
+5
source share
1 answer

I think this is a mistake. It will probably be fixed in the rest frame 3.5.1

See this problem: https://github.com/tomchristie/django-rest-framework/pull/4601#event-831195901

+3
source

Source: https://habr.com/ru/post/1258581/


All Articles