Skip to content

Commit

Permalink
chore: switch to edx_api_doc_tools
Browse files Browse the repository at this point in the history
  • Loading branch information
long74100 committed Sep 22, 2021
1 parent 69d0733 commit 3837626
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 123 deletions.
4 changes: 3 additions & 1 deletion license_manager/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
'django_filters',
'durationwidget',
'rest_framework',
'rest_framework_swagger',
'drf_yasg',
'edx_api_doc_tools',
'rules.apps.AutodiscoverRulesConfig',
'simple_history',
'simplejson',
'social_django',
'waffle',
)
Expand Down
15 changes: 13 additions & 2 deletions license_manager/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,35 @@
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from rest_framework_swagger.views import get_swagger_view
from drf_yasg.views import get_schema_view
from edx_api_doc_tools import make_api_info
from rest_framework import permissions

from license_manager.apps.api import urls as api_urls
from license_manager.apps.core import views as core_views


admin.autodiscover()


api_info = make_api_info(title="License Manager API", version="v1")
schema_view = get_schema_view(
api_info,
public=False,
permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
url(r'', include(oauth2_urlpatterns)),
url(r'', include('csrf.urls')), # Include csrf urls from edx-drf-extensions
url(r'^admin/', admin.site.urls),
url(r'^api/', include(api_urls)),
url(r'^api-docs/', get_swagger_view(title='License Manager API')),
url(r'^api-docs/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
url(r'^auto_auth/$', core_views.AutoAuth.as_view(), name='auto_auth'),
url(r'^health/$', core_views.health, name='health'),
]


if settings.DEBUG and os.environ.get('ENABLE_DJANGO_TOOLBAR', False): # pragma: no cover
# Disable pylint import error because we don't install django-debug-toolbar
# for CI build
Expand Down
3 changes: 2 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ django-durationwidget
django-extensions
django-filter
django-model-utils
django-rest-swagger
django-ses
rules
django-simple-history
django-waffle
djangorestframework
djangorestframework-csv
drf-nested-routers
edx-api-doc-tools
edx-auth-backends
edx-celeryutils
edx-django-utils
Expand All @@ -29,4 +29,5 @@ mysqlclient
pytz
redis
rules
simplejson
zipp
47 changes: 31 additions & 16 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ backoff==1.10.0
# analytics-python
billiard==3.6.4.0
# via celery
boto3==1.18.38
boto3==1.18.45
# via django-ses
botocore==1.21.38
botocore==1.21.45
# via
# boto3
# s3transfer
Expand All @@ -31,14 +31,14 @@ certifi==2021.5.30
# via requests
cffi==1.14.6
# via cryptography
charset-normalizer==2.0.4
charset-normalizer==2.0.6
# via requests
coreapi==2.3.3
# via
# django-rest-swagger
# openapi-codec
# via drf-yasg
coreschema==0.0.4
# via coreapi
# via
# coreapi
# drf-yasg
cryptography==3.4.8
# via
# pyjwt
Expand All @@ -61,6 +61,8 @@ django==3.2.7
# djangorestframework
# drf-jwt
# drf-nested-routers
# drf-yasg
# edx-api-doc-tools
# edx-auth-backends
# edx-celeryutils
# edx-django-utils
Expand All @@ -85,8 +87,6 @@ django-model-utils==4.1.1
# -r requirements/base.in
# edx-celeryutils
# edx-rbac
django-rest-swagger==2.2.0
# via -r requirements/base.in
django-ses==2.2.1
# via -r requirements/base.in
django-simple-history==3.0.0
Expand All @@ -99,10 +99,11 @@ django-waffle==2.2.1
djangorestframework==3.12.4
# via
# -r requirements/base.in
# django-rest-swagger
# djangorestframework-csv
# drf-jwt
# drf-nested-routers
# drf-yasg
# edx-api-doc-tools
# edx-drf-extensions
# rest-condition
djangorestframework-csv==2.1.1
Expand All @@ -113,6 +114,10 @@ drf-jwt==1.19.0
# edx-drf-extensions
drf-nested-routers==0.93.3
# via -r requirements/base.in
drf-yasg==1.20.0
# via edx-api-doc-tools
edx-api-doc-tools==1.5.0
# via -r requirements/base.in
edx-auth-backends==3.4.0
# via
# -c requirements/common_constraints.txt
Expand Down Expand Up @@ -142,6 +147,8 @@ future==0.18.2
# pyjwkest
idna==3.2
# via requests
inflection==0.5.1
# via drf-yasg
itypes==1.2.0
# via coreapi
jinja2==2.11.3
Expand All @@ -164,14 +171,14 @@ monotonic==1.6
# via analytics-python
mysqlclient==2.0.3
# via -r requirements/base.in
newrelic==6.8.1.164
newrelic==6.10.0.165
# via edx-django-utils
oauthlib==3.1.1
# via
# requests-oauthlib
# social-auth-core
openapi-codec==1.3.2
# via django-rest-swagger
packaging==21.0
# via drf-yasg
pbr==5.6.0
# via stevedore
psutil==5.8.0
Expand All @@ -191,6 +198,8 @@ pyjwt[crypto]==1.7.1
# social-auth-core
pymongo==3.12.0
# via edx-opaque-keys
pyparsing==2.4.7
# via packaging
python-dateutil==2.8.2
# via
# analytics-python
Expand Down Expand Up @@ -220,14 +229,18 @@ requests-oauthlib==1.3.0
# via social-auth-core
rest-condition==1.0.3
# via edx-drf-extensions
ruamel.yaml==0.17.16
# via drf-yasg
ruamel.yaml.clib==0.2.6
# via ruamel.yaml
rules==3.0
# via -r requirements/base.in
s3transfer==0.5.0
# via boto3
semantic-version==2.8.5
# via edx-drf-extensions
simplejson==3.17.5
# via django-rest-swagger
# via -r requirements/base.in
six==1.16.0
# via
# analytics-python
Expand All @@ -250,7 +263,7 @@ social-auth-core==4.0.2
# -c requirements/common_constraints.txt
# edx-auth-backends
# social-auth-app-django
sqlparse==0.4.1
sqlparse==0.4.2
# via django
stevedore==3.4.0
# via
Expand All @@ -259,7 +272,9 @@ stevedore==3.4.0
unicodecsv==0.14.1
# via djangorestframework-csv
uritemplate==3.0.1
# via coreapi
# via
# coreapi
# drf-yasg
urllib3==1.26.6
# via
# botocore
Expand Down
49 changes: 32 additions & 17 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ billiard==3.6.4.0
# via
# -r requirements/validation.txt
# celery
boto3==1.18.38
boto3==1.18.45
# via
# -r requirements/validation.txt
# django-ses
botocore==1.21.38
botocore==1.21.45
# via
# -r requirements/validation.txt
# boto3
Expand All @@ -53,7 +53,7 @@ cffi==1.14.6
# via
# -r requirements/validation.txt
# cryptography
charset-normalizer==2.0.4
charset-normalizer==2.0.6
# via
# -r requirements/validation.txt
# requests
Expand All @@ -77,12 +77,12 @@ code-annotations==1.2.0
coreapi==2.3.3
# via
# -r requirements/validation.txt
# django-rest-swagger
# openapi-codec
# drf-yasg
coreschema==0.0.4
# via
# -r requirements/validation.txt
# coreapi
# drf-yasg
coverage==5.5
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -120,6 +120,8 @@ django==3.2.7
# djangorestframework
# drf-jwt
# drf-nested-routers
# drf-yasg
# edx-api-doc-tools
# edx-auth-backends
# edx-celeryutils
# edx-django-utils
Expand Down Expand Up @@ -152,8 +154,6 @@ django-model-utils==4.1.1
# -r requirements/validation.txt
# edx-celeryutils
# edx-rbac
django-rest-swagger==2.2.0
# via -r requirements/validation.txt
django-ses==2.2.1
# via -r requirements/validation.txt
django-simple-history==3.0.0
Expand All @@ -166,10 +166,11 @@ django-waffle==2.2.1
djangorestframework==3.12.4
# via
# -r requirements/validation.txt
# django-rest-swagger
# djangorestframework-csv
# drf-jwt
# drf-nested-routers
# drf-yasg
# edx-api-doc-tools
# edx-drf-extensions
# rest-condition
djangorestframework-csv==2.1.1
Expand All @@ -181,6 +182,12 @@ drf-jwt==1.19.0
# edx-drf-extensions
drf-nested-routers==0.93.3
# via -r requirements/validation.txt
drf-yasg==1.20.0
# via
# -r requirements/validation.txt
# edx-api-doc-tools
edx-api-doc-tools==1.5.0
# via -r requirements/validation.txt
edx-auth-backends==3.4.0
# via
# -c requirements/common_constraints.txt
Expand Down Expand Up @@ -234,6 +241,10 @@ inflect==5.3.0
# via
# -r requirements/dev.in
# jinja2-pluralize
inflection==0.5.1
# via
# -r requirements/validation.txt
# drf-yasg
iniconfig==1.1.1
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -288,7 +299,7 @@ monotonic==1.6
# analytics-python
mysqlclient==2.0.3
# via -r requirements/validation.txt
newrelic==6.8.1.164
newrelic==6.10.0.165
# via
# -r requirements/validation.txt
# edx-django-utils
Expand All @@ -297,13 +308,10 @@ oauthlib==3.1.1
# -r requirements/validation.txt
# requests-oauthlib
# social-auth-core
openapi-codec==1.3.2
# via
# -r requirements/validation.txt
# django-rest-swagger
packaging==21.0
# via
# -r requirements/validation.txt
# drf-yasg
# pytest
path==16.2.0
# via
Expand Down Expand Up @@ -453,6 +461,14 @@ rest-condition==1.0.3
# via
# -r requirements/validation.txt
# edx-drf-extensions
ruamel.yaml==0.17.16
# via
# -r requirements/validation.txt
# drf-yasg
ruamel.yaml.clib==0.2.6
# via
# -r requirements/validation.txt
# ruamel.yaml
rules==3.0
# via -r requirements/validation.txt
s3transfer==0.5.0
Expand All @@ -464,9 +480,7 @@ semantic-version==2.8.5
# -r requirements/validation.txt
# edx-drf-extensions
simplejson==3.17.5
# via
# -r requirements/validation.txt
# django-rest-swagger
# via -r requirements/validation.txt
six==1.16.0
# via
# -r requirements/validation.txt
Expand Down Expand Up @@ -502,7 +516,7 @@ social-auth-core==4.0.2
# -r requirements/validation.txt
# edx-auth-backends
# social-auth-app-django
sqlparse==0.4.1
sqlparse==0.4.2
# via
# -r requirements/validation.txt
# django
Expand Down Expand Up @@ -536,6 +550,7 @@ uritemplate==3.0.1
# via
# -r requirements/validation.txt
# coreapi
# drf-yasg
urllib3==1.26.6
# via
# -r requirements/validation.txt
Expand Down
Loading

0 comments on commit 3837626

Please sign in to comment.