From 36e5759498386d858aeb01261fdd3078ed8f17b8 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Wed, 19 Apr 2017 07:49:13 +0200 Subject: [PATCH] Add documentation for the `get_schema_view` new argument: `patterns` --- docs/api-guide/schemas.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/api-guide/schemas.md b/docs/api-guide/schemas.md index f43ff56bd..5bbe8f533 100644 --- a/docs/api-guide/schemas.md +++ b/docs/api-guide/schemas.md @@ -170,6 +170,22 @@ May be used to pass the set of renderer classes that can be used to render the A renderer_classes=[CoreJSONRenderer, APIBlueprintRenderer] ) +#### `patterns` + +List of url patterns to limit the schema introspection to. If you only want the `myproject.api` urls +to be exposed in the schema: + + schema_url_patterns = [ + url(r'^api/', include('myproject.api.urls')), + ] + + schema_view = get_schema_view( + title='Server Monitoring API', + url='https://www.example.org/api/', + patterns=schema_url_patterns, + ) + + ## Using an explicit schema view If you need a little more control than the `get_schema_view()` shortcut gives you,