Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
64e801e4
Commit
64e801e4
authored
Jan 06, 2017
by
Roman Vasilyev
Committed by
Tom Christie
Jan 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get view for django 'virtual hosts' (#4776)
Brill, thanks!
馃憤
parent
a5fcf10c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
docs/api-guide/schemas.md
+12
-0
rest_framework/schemas.py
+2
-2
No files found.
docs/api-guide/schemas.md
View file @
64e801e4
...
...
@@ -145,6 +145,18 @@ May be used to pass a canonical URL for the schema.
url='https://www.example.org/api/'
)
#### `urlconf`
A string representing the import path to the URL conf that you want
to generate an API schema for. This defaults to the value of Django's
ROOT_URLCONF setting.
schema_view = get_schema_view(
title='Server Monitoring API',
url='https://www.example.org/api/',
urlconf='myproject.urls'
)
#### `renderer_classes`
May be used to pass the set of renderer classes that can be used to render the API root endpoint.
...
...
rest_framework/schemas.py
View file @
64e801e4
...
...
@@ -571,11 +571,11 @@ class SchemaGenerator(object):
return
named_path_components
+
[
action
]
def
get_schema_view
(
title
=
None
,
url
=
None
,
renderer_classes
=
None
):
def
get_schema_view
(
title
=
None
,
url
=
None
,
urlconf
=
None
,
renderer_classes
=
None
):
"""
Return a schema view.
"""
generator
=
SchemaGenerator
(
title
=
title
,
url
=
url
)
generator
=
SchemaGenerator
(
title
=
title
,
url
=
url
,
urlconf
=
urlconf
)
if
renderer_classes
is
None
:
if
renderers
.
BrowsableAPIRenderer
in
api_settings
.
DEFAULT_RENDERER_CLASSES
:
rclasses
=
[
renderers
.
CoreJSONRenderer
,
renderers
.
BrowsableAPIRenderer
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment