Enable Studio API docs in devstack

This commit is contained in:
Ned Batchelder
2019-06-07 13:57:06 -04:00
parent 135cbe76d8
commit f0fa5f7169
3 changed files with 9 additions and 3 deletions

View File

@@ -1173,7 +1173,7 @@ INSTALLED_APPS = [
'pipeline_mako',
# API Documentation
'rest_framework_swagger',
'drf_yasg',
'openedx.features.course_duration_limits',
'openedx.features.content_type_gating',

View File

@@ -108,6 +108,10 @@ def should_show_debug_toolbar(request):
DEBUG_TOOLBAR_MONGO_STACKTRACES = False
########################### API DOCS #################################
FEATURES['ENABLE_API_DOCS'] = True
################################ MILESTONES ################################
FEATURES['MILESTONES_APP'] = True

View File

@@ -3,7 +3,7 @@ from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.admin import autodiscover as django_autodiscover
from django.utils.translation import ugettext_lazy as _
from rest_framework_swagger.views import get_swagger_view
from openedx.core.openapi import schema_view
import contentstore.views
from cms.djangoapps.contentstore.views.organization import OrganizationListView
@@ -266,7 +266,9 @@ urlpatterns += [
if settings.FEATURES.get('ENABLE_API_DOCS'):
urlpatterns += [
url(r'^api-docs/$', get_swagger_view(title='Studio API')),
url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
url(r'^api-docs/$', schema_view.with_ui('swagger', cache_timeout=0)),
]
from openedx.core.djangoapps.plugins import constants as plugin_constants, plugin_urls