docs(openapi): add drf-spectacular and default settings

This commit is contained in:
indyandie 2024-02-24 01:31:34 -06:00
parent 6775022635
commit 4bc132d82c
No known key found for this signature in database
GPG key ID: FDB83C1AED3933E1
2 changed files with 12 additions and 0 deletions

View file

@ -99,6 +99,7 @@ INSTALLED_APPS = (
"corsheaders", "corsheaders",
"rest_framework", "rest_framework",
"cachalot", "cachalot",
'drf_spectacular',
) + CUSTOM_APPS ) + CUSTOM_APPS
@ -116,6 +117,7 @@ REST_FRAMEWORK = {
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
"PAGE_SIZE": 20, "PAGE_SIZE": 20,
"PAGINATE_BY": 20, "PAGINATE_BY": 20,
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
} }
@ -136,3 +138,12 @@ TEMPLATES = [
] ]
DEFAULT_AUTO_FIELD = "django.db.models.AutoField" DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
SPECTACULAR_SETTINGS = {
'TITLE': 'Your Project API',
'DESCRIPTION': 'Your project description',
'VERSION': '1.0.0',
'SERVE_INCLUDE_SCHEMA': False,
# OTHER SETTINGS
}

View file

@ -11,3 +11,4 @@ mimeparse==0.1.3
psycopg2-binary==2.9.9 psycopg2-binary==2.9.9
python-dateutil==2.8.2 python-dateutil==2.8.2
python-mimeparse==1.6.0 python-mimeparse==1.6.0
drf-spectacular==0.27.1