Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use drf-yasg for demo project #215

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/demo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'dj_rest_auth.registration',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'rest_framework_swagger',
'drf_yasg',
'corsheaders'
)

Expand Down
12 changes: 10 additions & 2 deletions demo/demo/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView, TemplateView
from rest_framework_swagger.views import get_swagger_view
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
openapi.Info(
title='API Docs',
default_version='v1',
)
)

urlpatterns = [
url(r'^$', TemplateView.as_view(template_name="home.html"), name='home'),
Expand Down Expand Up @@ -39,5 +47,5 @@
url(r'^account/', include('allauth.urls')),
url(r'^admin/', admin.site.urls),
url(r'^accounts/profile/$', RedirectView.as_view(url='/', permanent=True), name='profile-redirect'),
url(r'^docs/$', get_swagger_view(title='API Docs'), name='api_docs')
url(r'^docs/$', schema_view.with_ui('swagger', cache_timeout=0), name='api_docs')
]
2 changes: 1 addition & 1 deletion demo/requirements.pip
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ dj-rest-auth @ git+https://github.com/jazzband/dj-rest-auth.git@master
djangorestframework>=3.11.0
djangorestframework-simplejwt==4.4.0
django-allauth>=0.24.1
django-rest-swagger==2.0.7
drf-yasg==1.20.0
django-cors-headers==3.2.1
coreapi==2.3.3