Move API documentation views API app

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-12 02:03:22 -04:00
parent 1fa91f0ef7
commit 0416ac4064
6 changed files with 36 additions and 19 deletions

View File

@@ -2,7 +2,7 @@ from __future__ import unicode_literals
from django.conf.urls import include, url
from .api_views import APIRoot, BrowseableObtainAuthToken
from .api_views import APIRoot, BrowseableObtainAuthToken, schema_view
api_urls = [
@@ -14,5 +14,21 @@ api_urls = [
]
urlpatterns = [
url(
regex=r'^auth/token/obtain/$', name='auth_token_obtain',
view=BrowseableObtainAuthToken.as_view()
),
url(
regex=r'^swagger(?P<format>.json|.yaml)$', name='schema-json',
view=schema_view.without_ui(cache_timeout=None),
),
url(
regex=r'^swagger/$', name='schema-swagger-ui',
view=schema_view.with_ui('swagger', cache_timeout=None)
),
url(
regex=r'^redoc/$', name='schema-redoc',
view=schema_view.with_ui('redoc', cache_timeout=None)
),
url(r'^', include(api_urls)),
]