Skip to content

fl_server.settings.development

Functions:

Name Description
get_redis_location

Attributes:

Name Type Description
ALLOWED_HOSTS
AUTH_PASSWORD_VALIDATORS
AUTH_USER_MODEL
BASE_DIR
CACHES
CELERY_ACCEPT_CONTENT
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP
CELERY_RESULT_SERIALIZER
CELERY_TASK_ALWAYS_EAGER
CELERY_TASK_SERIALIZER
CELERY_TASK_TIME_LIMIT
CELERY_TASK_TRACK_STARTED
CELERY_TIMEZONE
CORS_ALLOWED_ORIGIN_REGEXES
CORS_ALLOW_ALL_ORIGINS
CORS_ORIGIN_WHITELIST
CSRF_COOKIE_SECURE
DATABASES
DEBUG
DEFAULT_AUTO_FIELD
INSTALLED_APPS
LANGUAGE_CODE
LOGGING
MAX_RUNNING_CHILD_PROCESSES
MIDDLEWARE
REST_FRAMEWORK
ROOT_URLCONF
SECRET_KEY
SESSION_COOKIE_SECURE
SPECTACULAR_SETTINGS
SSL_FORCE
STATIC_URL
TEMPLATES
TIME_ZONE
USE_I18N
USE_TZ
WSGI_APPLICATION

Attributes

ALLOWED_HOSTS module-attribute

ALLOWED_HOSTS = ['*']

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'}]

AUTH_USER_MODEL module-attribute

AUTH_USER_MODEL = 'fl_server_core.User'

BASE_DIR module-attribute

BASE_DIR = parent

CACHES module-attribute

CACHES = {'redis': {'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': get_redis_location(), 'OPTIONS': {'CLIENT_CLASS': 'django_redis.client.DefaultClient'}}}

CELERY_ACCEPT_CONTENT module-attribute

CELERY_ACCEPT_CONTENT = ['pickle']

CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP module-attribute

CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True

CELERY_RESULT_SERIALIZER module-attribute

CELERY_RESULT_SERIALIZER = 'pickle'

CELERY_TASK_ALWAYS_EAGER module-attribute

CELERY_TASK_ALWAYS_EAGER = False

CELERY_TASK_SERIALIZER module-attribute

CELERY_TASK_SERIALIZER = 'pickle'

CELERY_TASK_TIME_LIMIT module-attribute

CELERY_TASK_TIME_LIMIT = 30 * 60

CELERY_TASK_TRACK_STARTED module-attribute

CELERY_TASK_TRACK_STARTED = True

CELERY_TIMEZONE module-attribute

CELERY_TIMEZONE = TIME_ZONE

CORS_ALLOWED_ORIGIN_REGEXES module-attribute

CORS_ALLOWED_ORIGIN_REGEXES = splitlines()

CORS_ALLOW_ALL_ORIGINS module-attribute

CORS_ALLOW_ALL_ORIGINS = True

CORS_ORIGIN_WHITELIST module-attribute

CORS_ORIGIN_WHITELIST = splitlines()
CSRF_COOKIE_SECURE = 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')}}

DEBUG module-attribute

DEBUG = True

DEFAULT_AUTO_FIELD module-attribute

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

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']

LANGUAGE_CODE module-attribute

LANGUAGE_CODE = 'en-us'

LOGGING module-attribute

LOGGING = get_default_logging_dict(str(BASE_DIR / 'logs' / 'server.log'))

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

REST_FRAMEWORK = {'DEFAULT_SCHEMA_CLASS': 'fl_server_api.openapi.CustomAutoSchema'}

ROOT_URLCONF module-attribute

ROOT_URLCONF = 'fl_server.urls'

SECRET_KEY module-attribute

SECRET_KEY = 'django-insecure-*z=iw5n%b--qdim+x5b+j9=^_gq7hq)kk8@7$^(tyn@oc#_8by'
SESSION_COOKIE_SECURE = True

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']}

SSL_FORCE module-attribute

SSL_FORCE = str2bool(get('FL_SSL_FORCE_REQUESTS'), 'test' not in argv)

STATIC_URL module-attribute

STATIC_URL = 'static/'

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

TIME_ZONE = 'Europe/Berlin'

USE_I18N module-attribute

USE_I18N = True

USE_TZ module-attribute

USE_TZ = True

WSGI_APPLICATION module-attribute

WSGI_APPLICATION = 'fl_server.wsgi.application'

Functions

get_redis_location

get_redis_location(*, fallback_host: str = 'redis') -> str
Source code in fl_server/settings/base.py
def get_redis_location(*, fallback_host: str = "redis") -> str:
    if (location := environ.get("FL_REDIS_LOCATION")) is not None:
        return location
    host = environ.get("FL_REDIS_HOST", fallback_host)
    post = environ.get("FL_REDIS_PORT", "6379")
    return f"redis://{host}:{post}/1"