From fc4a68036776177c3e188115ec7b70657ebbb6e9 Mon Sep 17 00:00:00 2001 From: PRITAM CHAKRABORTY Date: Sat, 5 Mar 2022 12:48:58 +0530 Subject: [PATCH] Swagger Done for v1 --- blogapp/urls.py | 1 - core/settings/common.py | 13 +++++++++++-- core/urls.py | 7 ++++++- db.sqlite3 | Bin 176128 -> 176128 bytes 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/blogapp/urls.py b/blogapp/urls.py index 9621c2b..cb6429d 100644 --- a/blogapp/urls.py +++ b/blogapp/urls.py @@ -13,7 +13,6 @@ # all_blogger_blogs.register('blogs', OwnerBlogListVSet, 'blogs') - comment_router = NestedDefaultRouter(all_blogger_blogs, 'blog', lookup='blog') comment_router.register('comments', CommentVSet, basename='comments') diff --git a/core/settings/common.py b/core/settings/common.py index a32d4d9..ac434ab 100644 --- a/core/settings/common.py +++ b/core/settings/common.py @@ -63,7 +63,14 @@ ROOT_URLCONF = 'core.urls' -SWAGGER_SETTINGS = {"DEFAULT_AUTO_SCHEMA_CLASS": "blogapp.swagger_schema.CustomAutoSchema"} +SWAGGER_SETTINGS = { + "DEFAULT_AUTO_SCHEMA_CLASS": "blogapp.swagger_schema.CustomAutoSchema", + "LOGIN_URL": 'admin/', + "LOGOUT_URL":'admin/logout', + "OPERATIONS_SORTER":'method', + "TAGS_SORTER":'alpha', + "DOC_EXPANSION":"none", +} TEMPLATES = [ { @@ -135,7 +142,9 @@ ), 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticatedOrReadOnly', - ] + ], + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', + 'PAGE_SIZE': 5, } SIMPLE_JWT = { diff --git a/core/urls.py b/core/urls.py index 817da00..418b1aa 100644 --- a/core/urls.py +++ b/core/urls.py @@ -28,7 +28,12 @@ openapi.Info( title="Blogapp API", default_version='v1', - description="Test description", + description=""" + # This is the `Blogapp API` documentation + + > ### Here all the api routes are grouped by tags + + """, # terms_of_service="https://www.google.com/policies/terms/", # contact=openapi.Contact(email="pritam.chk98@gmail.com"), # license=openapi.License(name="BSD License"), diff --git a/db.sqlite3 b/db.sqlite3 index ad84aa6f263b0c8103426420536c4d774f650eca..fbd151ce70737b6a04f0fde3b71f17ba7ef104e1 100644 GIT binary patch delta 46 zcmZp8z}4`8Yl1Z6`H3>ljOQB@S`!$zCNTX};WM)`HnuW0(K9o!Ffq5-p03I?vkL%< C-w$U1 delta 46 zcmZp8z}4`8Yl1Z6*@-gFjAt7YS`!$zCNTX};WM=|va~Wa*E2ITFtjk+p03I?vkL%< CcMo9z