fl_server.settings.production ¶
Functions:
| Name | Description |
|---|---|
get_redis_location | |
get_secret | Get secret value from an environment variable or a file. |
Attributes:
Attributes¶
AUTH_PASSWORD_VALIDATORS module-attribute ¶
AUTH_PASSWORD_VALIDATORS = [{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'}, {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'}, {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}]
BASE_DIR module-attribute ¶
- API Reference
fl_serversettings
CACHES module-attribute ¶
CACHES = {'redis': {'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': get_redis_location(), 'OPTIONS': {'CLIENT_CLASS': 'django_redis.client.DefaultClient'}}}
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP module-attribute ¶
CORS_ALLOW_ALL_ORIGINS module-attribute ¶
CORS_ALLOW_ALL_ORIGINS = str2bool(get('CORS_ALLOW_ALL_ORIGINS', 'False'))
DATABASES module-attribute ¶
DATABASES = {'postgresql': {'ENGINE': 'django.db.backends.postgresql', 'HOST': get('FL_POSTGRES_HOST', 'db'), 'PORT': get('FL_POSTGRES_PORT', '5432'), 'NAME': get('FL_POSTGRES_DBNAME', 'demo'), 'USER': get('FL_POSTGRES_USER', 'demo'), 'PASSWORD': get('FL_POSTGRES_PASSWD', 'example')}}
INSTALLED_APPS module-attribute ¶
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth', 'polymorphic', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'corsheaders', 'rest_framework', 'rest_framework.authtoken', 'fl_server_core', 'fl_server_ai', 'fl_server_api', 'drf_spectacular', 'django.contrib.postgres']
LOGGING module-attribute ¶
MAX_RUNNING_CHILD_PROCESSES module-attribute ¶
MAX_RUNNING_CHILD_PROCESSES = int(get('FL_MAX_CHILD_PROCESSES', 8))
MIDDLEWARE module-attribute ¶
MIDDLEWARE = ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']
REST_FRAMEWORK module-attribute ¶
SPECTACULAR_SETTINGS module-attribute ¶
SPECTACULAR_SETTINGS = {'TITLE': 'Federated Learning Demonstrator Server API', 'DESCRIPTION': '\nThis OpenAPI Specification describes the server component of the Federated Learning Demonstrator,\na sophisticated suite of tools designed for machine learning applications within a federated context.\nThis server component plays a crucial role by orchestrating and notifying all training participants to ensure seamless\nand efficient operation.\n\nThe complete Federated Learning (FL) demonstation platform acts as a proof of concept within the\n[Catena-X](https://catena-x.net/en) project.\nThe primary goal is to demonstrate the feasibility and effectiveness of federated learning in real-world scenarios.\n\nFor a comprehensive understanding and further details about the Federated Learning (FL) platform,\nplease refer to the official [FL platform documentation](https://dlr-ki.github.io/fl-documentation).\n\nUse this OpenAPI Specification to explore and interact with the various endpoints provided by the server component\nof the Federated Learning Demonstrator.\nThis specification will help developers, researchers, and data scientists to integrate, extend, and utilize\nfederated learning capabilities effectively.\n', 'VERSION': version('fl-demonstrator'), 'SERVE_AUTHENTICATION': [], 'PREPROCESSING_HOOKS': ['fl_server_api.openapi.custom_preprocessing_hook']}
STATIC_URL module-attribute ¶
- API Reference
fl_serversettingsproduction AttributesADMIN_MEDIA_PREFIX
TEMPLATES module-attribute ¶
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}]
TIME_ZONE module-attribute ¶
- API Reference
fl_serversettings
Functions¶
get_redis_location ¶
- API Reference
fl_serversettings
Source code in fl_server/settings/base.py
get_secret ¶
Get secret value from an environment variable or a file.
This function first checks if there is an environment variable named "{env_key}_FILE". If such a variable exists, the function reads the secret value from the file specified by this variable. If the variable does not exist, the function retrieves the secret value from the environment variable passed by the parameter env_key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
| str | The name of the environment variable to retrieve the secret value from. | required |
| bool | If | False |
Returns:
| Type | Description |
|---|---|
str | None | str | None: The secret value, or None if neither "{env_key}_FILE" nor "{env_key}" is set and ensure is |
Raises:
| Type | Description |
|---|---|
KeyError | If neither "{env_key}_FILE" nor "{env_key}" is set and ensure is True. |
- API Reference
fl_serversettingsproduction AttributesSECRET_KEY