Restrict doc & schema shortcuts to a subset of urls by xordoquy · Pull Request #4979 · encode/django-rest-framework (original) (raw)

This change will help removing a lot of boilerplate code to restrict the documentation and schema to a single subset of urls:

doc_url_patterns = [
    url(r'^api/v1/', include('invoices.api.urls')),
]

urlpatterns = [
    url(r'^api/v1/docs/', include_docs_urls(title='My API title', patterns=doc_url_patterns)),
]

This will prove helpful when the site exposes different APIs.

closes #4751