Skip to content

Commit

Permalink
Swagger Done for v1
Browse files Browse the repository at this point in the history
  • Loading branch information
PRITAM CHAKRABORTY committed Mar 5, 2022
1 parent 34195eb commit fc4a680
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 0 additions & 1 deletion blogapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
13 changes: 11 additions & 2 deletions core/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -135,7 +142,9 @@
),
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticatedOrReadOnly',
]
],
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 5,
}

SIMPLE_JWT = {
Expand Down
7 changes: 6 additions & 1 deletion core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Binary file modified db.sqlite3
Binary file not shown.

0 comments on commit fc4a680

Please sign in to comment.