This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Description
- DRF OpenAPI version: 1.3.0
- DRF version: 3.6.4
- Python version: 2.7
- Operating System: Ubuntu 16.04 (Docker) and MacOS
Description
I tried to add drf_openapi to an existing project.
What I Did
I have added drf-openapi==1.3.0 to my requirements.txt and installed it. I've added 'drf_openapi', to INSTALLED_APPS and url(r'^/docs/', include('drf_openapi.urls')) to the urlpatterns.
When starting the Docker image (or just runserver locally) this results in the following error:
File "/usr/local/lib/python2.7/dist-packages/drf_openapi/views.py", line 7, in <module>
from drf_openapi.entities import OpenApiSchemaGenerator
File "/usr/local/lib/python2.7/dist-packages/drf_openapi/entities.py", line 16, in <module>
from rest_framework.schemas.generators import insert_into, distribute_links, LinkNode
ImportError: No module named generators
If it makes any difference our DEFAULT_VERSIONING_CLASS is set to AcceptHeaderVersioning.
REST_FRAMEWORK = {
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.AcceptHeaderVersioning',
'DEFAULT_VERSION': API_VERSION,
}
Obviously I'm missing something out in the open here. The default documentation in DRF does work for us.