Settings
Note
If you're unsure about what "Django settings" are, you can refer to How to Edit Django Settings in OpenWISP for guidance.
OPENWISP_ORGANIZATION_USER_ADMIN
type: |
|
default: |
|
Indicates whether the admin section for managing OrganizationUser
items is enabled or not.
OPENWISP_ORGANIZATION_OWNER_ADMIN
type: |
|
default: |
|
Indicates whether the admin section for managing OrganizationOwner
items is enabled or not.
Refer to Organization Owners for more information.
OPENWISP_USERS_AUTH_API
type: |
|
default: |
|
Indicates whether the REST API is enabled or not.
OPENWISP_USERS_AUTH_THROTTLE_RATE
type: |
|
default: |
|
Indicates the rate throttling for the Obtain Authentication Token API endpoint.
Please note that the current rate throttler is very basic and will also count valid requests for rate limiting. For more information, check Django-rest-framework throttling guide.
OPENWISP_USERS_AUTH_BACKEND_AUTO_PREFIXES
type: |
|
default: |
|
A tuple or list of international prefixes which will be automatically tested by the authentication backend of OpenWISP Users when parsing phone numbers.
Each prefix will be prepended to the username string automatically and
parsed with the phonenumbers library to find out if the result is a
valid number of not.
This allows users to log in by using only the national phone number, without having to specify the international prefix.
OPENWISP_USERS_EXPORT_USERS_COMMAND_CONFIG
type: |
|
default: |
|
Note
The callable value must be a Python callable (function or method),
not a string path. Ensure the function is imported in your settings
file before referencing it.
This setting configures the fields exported by the export_users management command.
Field definitions
Each entry in fields can be either:
A string, representing a direct attribute of the user model:
"email"A dictionary, allowing advanced customization:
{ "name": "organizations", "callable": my_custom_function, }
The following keys are supported in field dictionaries:
name(str): the field name used as the fallback CSV column header.callable(callable, optional): a function that takes the user instance as input and returns the value to be exported.fields(list of str, optional): a list of attributes to extract from a related object or queryset.header(str, optional): a custom CSV column header. When provided, it overrides the default header generation.header_fields(list of str, optional): a list of subfield names to display in the header asname (field1, field2). If not provided, falls back tofields.
Priority order:
If
callableis provided, it is used.Else if
fieldsis provided, the related object(s) are serialized.Otherwise, the value is resolved using
name.
Query optimization
select_relatedcan be used forForeignKeyandOneToOnerelations.prefetch_relatedcan be used for reverse relations andManyToManyfields.
Example:
{
"fields": [
"username",
"email",
"profile.phone_number",
{
"name": "groups",
"fields": ["name"],
},
],
"select_related": ["profile"],
"prefetch_related": ["groups"],
}
OPENWISP_USERS_USER_PASSWORD_EXPIRATION
type: |
|
default: |
|
Number of days after which a user's password will expire. In other words, it determines when users will be prompted to change their passwords.
If set to 0, this feature is disabled, and users are not required to
change their passwords.
OPENWISP_USERS_STAFF_USER_PASSWORD_EXPIRATION
type: |
|
default: |
|
Similar to OPENWISP_USERS_USER_PASSWORD_EXPIRATION, but for staff users.