fairdm.api.settings#
Django REST Framework, OpenAPI and CORS settings for the FairDM API.
These settings configure the Django REST Framework, drf-spectacular (OpenAPI), and CORS. They are merged into the main Django settings via fairdm/conf/settings/api.py.
Portal developers can override any of these in their own settings:
# In portal's settings.py
REST_FRAMEWORK["DEFAULT_THROTTLE_RATES"]["user_day"] = "50000/day"
REST_FRAMEWORK["PAGE_SIZE"] = 50
FAIRDM_API_MAX_PAGE_SIZE = 500
SPECTACULAR_SETTINGS["TITLE"] = "My Research Portal API"
SPECTACULAR_SETTINGS["DESCRIPTION"] = "A specialised API for geochemical data."
FAIRDM_API_TITLE and FAIRDM_API_DESCRIPTION below are the defaults that
SPECTACULAR_SETTINGS is built from once, when this module is imported. A portal changes the
title and description by assigning items of SPECTACULAR_SETTINGS, after fairdm.setup()
returns. It assigns items and never a new dictionary: replacing the dictionary drops the hook
that writes the limits into the description.
Module Contents#
Data#
API#
- FAIRDM_API_TITLE#
‘FairDM Portal API’
- FAIRDM_API_DESCRIPTION = <Multiline-String>#
- FAIRDM_API_MAX_PAGE_SIZE#
1000
- REST_FRAMEWORK#
None
- SPECTACULAR_SETTINGS#
None
- CORS_ALLOW_ALL_ORIGINS#
True
- CORS_ALLOWED_ORIGINS: list[str]#
[]
- CORS_URLS_REGEX#
‘^/api/.*$’
- REST_KNOX#
None