Stupid question: have you installed the coreapi package?

Antoine

Le lundi 13 mars 2017 17:18:56 UTC+1, Daviddd a écrit :
>
> Dear All,
>
> Django 1.10.6
> Django-rest-framework 3.6.2
>
>
> ```
> #api/urls.py
> def include_version(version):
>     """
>     Returns an include statement containing URL patterns for the passed 
> API version.
>     """
>     kwargs = {}
>     if version != settings.API_CURRENT_VERSION:
>         kwargs['namespace'] = 'api-v{0}'.format(version)
>     else:
>         kwargs['namespace'] = 'default'
>
>     return include('proj.api.v{0}.urls'.format(version), **kwargs)
>
> urlpatterns = [
>     url(r'^v1/', include_version(1)),
>     # url(r''^v2/', include_version(2)),
> ]
>
> ```
>
> ```
> #api/v1/urls.py
>
> from rest_framework.documentation import include_docs_urls
>
> urlpatterns = [
>     url(r'^docs/', include_docs_urls(title='GMB API')),
>     **
>     ***
>     url(r'^api-token-auth/', obtain_jwt_token, name='api-token-auth'),
>     url(r'^api-token-refresh/', refresh_jwt_token, 
> name='api-token-refresh'),
>     ****
>
> ```
>
> But I got a "django.urls.exceptions.NoReverseMatch: 'api-docs' is not a 
> registered namespace" in
> `File "*/python3.5/site-packages/django/urls/base.py", line 87, in 
> reverse`. 
> I suppose (please correct me if not) having defined my versioned namespace 
> creates troubles here: 
> https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/documentation.py#L50
>
> Thanks,
>
> D
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to