cannot load endpoints from different urls files
In case someone is using subdomains and his api endpoints are in a separate urls.py file (ex.: api_urls.py) its unable to find the routes. IMHO it would be great to have a setting (variable) in settings.py where this file can be defined and not strictly use the base urls.py.
Hi, I don't know if this solves the issue of using subdomains, but it solves having urls in different files. You can check out this branch https://github.com/alej0varas/django-rest-framework-docs/tree/issue-61. I'm not creating a PR because I haven't tested the code enough.
This branch does fix an issue I encountered with nested urls includes.
Consider this url structure and snippets of urlpatterns (in which the endpoints are namedspaced to a version (here, v1)):
urls.py # A
api/
urls.py # B
v1/
urls.py # C
--
# urls A
url(r'^api/', include('api.urls')),
# urls B
url(r'^token-auth/$', token.obtain_auth_token),
url(r'^v1/', include('api.v1.urls', namespace='v1')),
# urls C
url(r'^foo/$', views.foo),
While the master branch ApiDocumentation.get_all_view_names resolves the path /api/token_auth/ as expected, the path in C is resolved as /foo/.
This branch resolves it to the expected /api/v1/foo/.
Would be nice to see a version of this branch make it into master to address this issue :)