[Django]-Why am I getting a "no module named urls" error for django rest framework swagger?

5👍

for Django > 1.10 project urls.py

from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='API name')
from django.urls import path
urlpatterns = [
    path('', schema_view)
]  

urlpatterns += [
# your patterns here
]

2👍

This issue is because of django-rest-swagger version. Try to install swagger 0.3.5 version using pip install django-rest-swagger===0.3.5 with django 1.9. If you django version is 1.10, then follow the link below to solve the issue https://github.com/marcgibbons/django-rest-swagger/issues/452

Leave a comment