AnnShress AnnShress - 1 year ago 186
Python Question

coreapi must be installed to use 'get_schema_fields()'

So I installed django-rest-swagger as shown in 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 on getting following error,

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

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


Installed Apps :

  • 'rest_framework',

  • 'rest_framework_swagger', ...

Answer Source

I think it's a bug. It will probably be fixed in rest framework 3.5.1

See this issue:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download