add drf-yasg
This commit is contained in:
parent
8a40e7abb2
commit
d82ab37b0b
4 changed files with 53 additions and 19 deletions
|
|
@ -37,6 +37,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'drf_yasg',
|
||||
'oauth2_provider',
|
||||
'rest_framework',
|
||||
'corsheaders',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ from django.conf.urls.static import static
|
|||
from django.contrib.auth.views import LogoutView
|
||||
from django.urls import path, include
|
||||
from django.contrib import admin
|
||||
from rest_framework import permissions
|
||||
from drf_yasg.views import get_schema_view
|
||||
from drf_yasg import openapi
|
||||
|
||||
|
||||
|
||||
# from apps.gooyal_oauth2.views.introspect import introspect_token
|
||||
from apps.transactions.views import TransactionList, TransactionDetail, TransactionPay, TransactionReceipt, \
|
||||
|
|
@ -27,13 +32,29 @@ from apps.users.views import UserListView, UserDetailView, AccountView, RequestO
|
|||
OTPLoginView, home, ProvinceApiView, UserInquiryView
|
||||
from django.contrib.auth import urls as auth_urls
|
||||
|
||||
# Setup the URLs and include login URLs for the browsable API.
|
||||
|
||||
schema_view = get_schema_view(
|
||||
openapi.Info(
|
||||
title="Snippets API",
|
||||
default_version='v1',
|
||||
description="Test description",
|
||||
terms_of_service="https://www.google.com/policies/terms/",
|
||||
contact=openapi.Contact(email="contact@snippets.local"),
|
||||
license=openapi.License(name="BSD License"),
|
||||
),
|
||||
public=True,
|
||||
permission_classes=(permissions.AllowAny,),
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
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'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
||||
path('admin/', admin.site.urls),
|
||||
# path('accounts/', include(auth_urls)),
|
||||
path('login/', OTPLoginView.as_view(), name='login'),
|
||||
path('logout/', LogoutView.as_view(), name='logout'),
|
||||
path('', home, name='home'),
|
||||
# path('login/', OTPLoginView.as_view(), name='login'),
|
||||
# path('logout/', LogoutView.as_view(), name='logout'),
|
||||
# path('', home, name='home'),
|
||||
|
||||
# path('oauth2/introspect', introspect_token),
|
||||
# path('oauth2/introspect/', introspect_token, name='introspect'),
|
||||
|
|
@ -48,15 +69,15 @@ urlpatterns = [
|
|||
path('province', ProvinceApiView.as_view(), name='province'),
|
||||
path('inquiry/', UserInquiryView.as_view(), name='inquiry'),
|
||||
|
||||
path('transactions/', TransactionList.as_view(), name='transactions'),
|
||||
path('transactions/<uuid>', TransactionDetail.as_view(), name='transaction_detail'),
|
||||
path('transactions/<uuid>/pay', TransactionPay.as_view(), name='transaction_pay'),
|
||||
|
||||
path('deposit/', DepositSubmit.as_view(), name='deposit_submit'),
|
||||
path('deposit/<uuid>/verify', DepositVerify.as_view(), name='deposit_verify'),
|
||||
|
||||
path('withdraw/', WithdrawSubmit.as_view(), name='withdraw_submit'),
|
||||
path('withdraw/<uuid>/verify', WithdrawVerify.as_view(), name='withdraw_verify'),
|
||||
# path('transactions/', TransactionList.as_view(), name='transactions'),
|
||||
# path('transactions/<uuid>', TransactionDetail.as_view(), name='transaction_detail'),
|
||||
# path('transactions/<uuid>/pay', TransactionPay.as_view(), name='transaction_pay'),
|
||||
#
|
||||
# path('deposit/', DepositSubmit.as_view(), name='deposit_submit'),
|
||||
# path('deposit/<uuid>/verify', DepositVerify.as_view(), name='deposit_verify'),
|
||||
#
|
||||
# path('withdraw/', WithdrawSubmit.as_view(), name='withdraw_submit'),
|
||||
# path('withdraw/<uuid>/verify', WithdrawVerify.as_view(), name='withdraw_verify'),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
|||
|
|
@ -14,3 +14,4 @@ gunicorn
|
|||
gevent
|
||||
redis
|
||||
celery
|
||||
drf-yasg
|
||||
|
|
@ -10,31 +10,42 @@ billiard==3.6.3.0 # via celery
|
|||
celery==4.4.7 # via -r requirements.in
|
||||
certifi==2020.6.20 # via requests
|
||||
chardet==3.0.4 # via requests
|
||||
coreapi==2.3.3 # via drf-yasg
|
||||
coreschema==0.0.4 # via coreapi, drf-yasg
|
||||
django-cors-headers==3.5.0 # via -r requirements.in
|
||||
django-filter==2.3.0 # via -r requirements.in
|
||||
django-model-utils==4.0.0 # via -r requirements.in
|
||||
django-mysql==3.8.1 # via -r requirements.in
|
||||
django-oauth-toolkit==1.3.2 # via -r requirements.in
|
||||
django==3.1.1 # via -r requirements.in, django-cors-headers, django-filter, django-model-utils, django-mysql, django-oauth-toolkit, djangorestframework
|
||||
djangorestframework==3.11.1 # via -r requirements.in
|
||||
django==3.1.1 # via -r requirements.in, django-cors-headers, django-filter, django-model-utils, django-mysql, django-oauth-toolkit, djangorestframework, drf-yasg
|
||||
djangorestframework==3.11.1 # via -r requirements.in, drf-yasg
|
||||
drf-yasg==1.20.0 # via -r requirements.in
|
||||
gevent==20.6.2 # via -r requirements.in
|
||||
greenlet==0.4.16 # via gevent
|
||||
gunicorn==20.0.4 # via -r requirements.in
|
||||
idna==2.10 # via requests
|
||||
importlib-metadata==2.0.0 # via kombu, markdown
|
||||
inflection==0.5.1 # via drf-yasg
|
||||
itypes==1.2.0 # via coreapi
|
||||
jinja2==2.11.2 # via coreschema
|
||||
kombu==4.6.11 # via celery
|
||||
markdown==3.2.2 # via -r requirements.in
|
||||
markupsafe==1.1.1 # via jinja2
|
||||
mysqlclient==2.0.1 # via -r requirements.in
|
||||
oauthlib==3.1.0 # via django-oauth-toolkit
|
||||
packaging==20.4 # via drf-yasg
|
||||
pillow==7.2.0 # via -r requirements.in
|
||||
pyparsing==2.4.7 # via packaging
|
||||
python-decouple==3.3 # via -r requirements.in
|
||||
pytz==2020.1 # via celery, django
|
||||
redis==3.5.3 # via -r requirements.in
|
||||
requests==2.24.0 # via django-oauth-toolkit
|
||||
requests==2.24.0 # via coreapi, django-oauth-toolkit
|
||||
ruamel.yaml.clib==0.2.2 # via ruamel.yaml
|
||||
ruamel.yaml==0.16.12 # via drf-yasg
|
||||
six==1.15.0 # via packaging
|
||||
sqlparse==0.3.1 # via django
|
||||
uritemplate==3.0.1 # via coreapi, drf-yasg
|
||||
urllib3==1.25.10 # via requests
|
||||
vine==1.3.0 # via amqp, celery
|
||||
zipp==3.3.1 # via importlib-metadata
|
||||
zope.event==4.4 # via gevent
|
||||
zope.interface==5.1.0 # via gevent
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue