... | ... | @@ -591,7 +591,16 @@ class OriginV4RecordSerializer(IpListSerializer): |
|
|
|
|
|
# The settings file
|
|
|
|
|
|
|
|
|
The API app has its own setting file where all the settings about the API are set. This file is imported in the general setttings file only if `'api'` is in the `INSTALLED_APPS` variable. Thus the settings defined in the api can be easily retrieved via the the usual import `from django.conf import setttings`.
|
|
|
|
|
|
This file contains the following variables:
|
|
|
* **REST_FRAMEWORK**: The configuration related to DRF. See the [official DRF documentation on the settings](https://www.django-rest-framework.org/api-guide/settings/) for more.
|
|
|
* **API_CONTENT_TYPE_APP_LABEL**: The name of the fake content type. See [the ACL section](#the-acl-can_use_api) for details.
|
|
|
* **API_CONTENT_TYPE_MODEL**: The name of the fake model. See [the ACL section](#the-acl-can_use_api) for details.
|
|
|
* **API_PERMISSION_NAME**: The displayed name for the can_use_api ACL. See [the ACL section](#the-acl-can_use_api) for details.
|
|
|
* **API_PERMISSION_CODENAME**: The codename of the fake permission. See [the ACL section](#the-acl-can_use_api) for details.
|
|
|
* **API_APPS**: A set of apps to activate for the API to work (is added to the `INSTALLED_APPS` variable of the general settings)
|
|
|
* **API_TOKEN_DURATION**: The expiration time of the token in seconds
|
|
|
|
|
|
|
|
|
# The tests
|
... | ... | |