Core

This package is the main entry point for the application and contains all configuration for the other packages.

Apps

class integreat_cms.core.apps.CoreConfig(app_name, app_module)[source]

Bases: AppConfig

This class represents the Django-configuration of the backend.

See django.apps.AppConfig for more information.

Parameters:

name – The name of the app

__init__(app_name, app_module)[source]
classmethod create(entry)[source]

Factory that creates an app config from an entry in INSTALLED_APPS.

default_auto_field[source]
get_model(model_name, require_ready=True)[source]

Return the model with the given case-insensitive model_name.

Raise LookupError if no model exists with this name.

get_models(include_auto_created=False, include_swapped=False)[source]

Return an iterable of models.

By default, the following models aren’t included:

  • auto-created models for many-to-many relations without an explicit intermediate table,

  • models that have been swapped out.

Set the corresponding keyword argument to True to include such models. Keyword arguments aren’t documented; they’re a private API.

import_models()[source]
name: Final[str] = 'integreat_cms.core'[source]

Full Python path to the application

ready() None[source]

Override this method in subclasses to run code when Django starts.

Return type:

None

test_external_apis: bool = False[source]

Whether the availability of external APIs should be checked

verbose_name: Final[Promise] = 'Core'[source]

Human-readable name for the application

Authentication Backends

This file contains custom authentication backends, see Authentication backends and Other authentication sources.

class integreat_cms.core.authentication_backends.EmailAuthenticationBackend[source]

Bases: BaseBackend

This authentication backend allows users to login with their email address instead of their username

__init__()[source]
authenticate(request: HttpRequest, **kwargs: Any) User | None[source]

Try to authenticate a user with the given email and password

Parameters:
  • request (HttpRequest) – The current request

  • **kwargs (Any) – The supplied keyword arguments

Returns:

Either the authenticated user or None is the credentials were not valid

Return type:

User | None

get_all_permissions(user_obj, obj=None)[source]
get_group_permissions(user_obj, obj=None)[source]
get_user(user_id: int) User | None[source]

Get the user by its primary key

Parameters:

user_id (int) – The id of the user

Returns:

Either the user or None if no user with this id exists

Return type:

User | None

get_user_permissions(user_obj, obj=None)[source]
has_perm(user_obj, perm, obj=None)[source]

Circleci Settings

Django settings for our CircleCI workflow. All configuration is imported from settings except it sets all logging to simple console output. For more information on this file, see Django settings. For the full list of settings and their values, see Settings.

integreat_cms.core.circleci_settings.DEEPL_AUTH_KEY = 'dummy'[source]

Set dummy DeepL key to test automatic translations via DeepL API

integreat_cms.core.circleci_settings.DEEPL_ENABLED = True[source]

Enable manually because existing setting derives from the unset env var

integreat_cms.core.circleci_settings.FCM_CREDENTIALS = 'dummy'[source]

Set dummy credentials path to test push notifications

integreat_cms.core.circleci_settings.FCM_ENABLED = True[source]

Enable manually because existing setting derives from the unset env var

integreat_cms.core.circleci_settings.GOOGLE_APPLICATION_CREDENTIALS = 'dummy'[source]

Set dummy Google Translate credential path

integreat_cms.core.circleci_settings.GOOGLE_PROJECT_ID = 'dummy'[source]

Set dummy Google project ID

integreat_cms.core.circleci_settings.GOOGLE_TRANSLATE_ENABLED = True[source]

Enable manually because existing setting derives from the unset env var

integreat_cms.core.circleci_settings.LINKCHECK_DISABLE_LISTENERS = True[source]

Disable linkcheck listeners on CircleCI

integreat_cms.core.circleci_settings.LOGGING = {'disable_existing_loggers': False, 'filters': {'only_stdout': {'()': 'django.utils.log.CallbackFilter', 'callback': <function <lambda>>}}, 'formatters': {'logfile': {'()': <class 'integreat_cms.core.logging_formatter.RequestFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname:7} {name} - {message}', 'style': '{'}, 'management-command': {'()': <class 'integreat_cms.core.logging_formatter.ColorFormatter'>, 'format': '{message}', 'style': '{'}}, 'handlers': {'logfile': {'class': 'logging.FileHandler', 'filename': '/home/circleci/project/integreat_cms/integreat-cms.log', 'formatter': 'logfile'}, 'management-command-stderr': {'class': 'logging.StreamHandler', 'formatter': 'management-command', 'level': 'WARNING'}, 'management-command-stdout': {'class': 'logging.StreamHandler', 'filters': ['only_stdout'], 'formatter': 'management-command', 'level': 'DEBUG', 'stream': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>}}, 'loggers': {'auth': {'handlers': ['logfile'], 'level': 'INFO'}, 'integreat_cms': {'handlers': ['logfile'], 'level': 'DEBUG'}, 'integreat_cms.core.management.commands': {'handlers': ['management-command-stdout', 'management-command-stderr', 'logfile'], 'level': 'DEBUG', 'propagate': False}}, 'version': 1}[source]

Logging configuration dictionary (see LOGGING)

{
    'disable_existing_loggers': False,
    'filters': {
        'only_stdout': {
            '()': 'django.utils.log.CallbackFilter',
            'callback': <function <lambda> at 0x7f418a021e40>,
        },
    },
    'formatters': {
        'logfile': {
            '()': <class 'integreat_cms.core.logging_formatter.RequestFormatter'>,
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} {levelname:7} {name} - {message}',
            'style': '{',
        },
        'management-command': {
            '()': <class 'integreat_cms.core.logging_formatter.ColorFormatter'>,
            'format': '{message}',
            'style': '{',
        },
    },
    'handlers': {
        'logfile': {
            'class': 'logging.FileHandler',
            'filename': '/home/circleci/project/integreat_cms/integreat-cms.log',
            'formatter': 'logfile',
        },
        'management-command-stderr': {
            'class': 'logging.StreamHandler',
            'formatter': 'management-command',
            'level': 'WARNING',
        },
        'management-command-stdout': {
            'class': 'logging.StreamHandler',
            'filters': ['only_stdout'],
            'formatter': 'management-command',
            'level': 'DEBUG',
            'stream': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>,
        },
    },
    'loggers': {
        'auth': {'handlers': ['logfile'], 'level': 'INFO'},
        'integreat_cms': {'handlers': ['logfile'], 'level': 'DEBUG'},
        'integreat_cms.core.management.commands': {
            'handlers': [
                'management-command-stdout',
                'management-command-stderr',
                'logfile',
            ],
            'level': 'DEBUG',
            'propagate': False,
        },
    },
    'version': 1,
}
integreat_cms.core.circleci_settings.LOG_LEVEL = 'DEBUG'[source]

Use debug logging on CircleCI

integreat_cms.core.circleci_settings.MESSAGE_LOGGING_ENABLED = True[source]

Enable logging of all entries from the messages framework

integreat_cms.core.circleci_settings.SECRET_KEY = 'dummy'[source]

Set a dummy secret key for CircleCI build even if it’s not in debug mode

integreat_cms.core.circleci_settings.SUMM_AI_API_KEY = 'dummy'[source]

Set dummy SUMM.AI API key to test translations into Easy German

integreat_cms.core.circleci_settings.SUMM_AI_ENABLED = True[source]

Enable manually because existing setting derives from the unset env var

integreat_cms.core.circleci_settings.TEXTLAB_API_ENABLED = True[source]

Enable manually because existing setting derives from the unset env var

integreat_cms.core.circleci_settings.TEXTLAB_API_KEY = 'dummy'[source]

Set dummy Textlab key to test automatic translations via Textlab API

Context Processors

Context processors pass additional variables to templates (see Built-in template context processors).

integreat_cms.core.context_processors.constants_processor(request: HttpRequest) dict[str, str][source]

This context processor injects some of our constants into the template context.

Parameters:

request (HttpRequest) – The current http request

Returns:

A few of our constants

Return type:

dict[str, str]

integreat_cms.core.context_processors.settings_processor(request: HttpRequest) dict[str, Any][source]

This context processor injects a few settings into the template context.

Parameters:

request (HttpRequest) – The current http request

Returns:

A few of our settings

Return type:

dict[str, Any]

integreat_cms.core.context_processors.version_processor(request: HttpRequest) dict[str, str][source]

This context processor injects the current package version into the template context.

Parameters:

request (HttpRequest) – The current http request

Returns:

The currently installed version of this package

Return type:

dict[str, str]

Docker Settings

Django settings for different database configuration. The docker container started in tools/run.sh exposes the alternative port 5433.

All other settings are imported from settings.

For more information on this file, see Django settings. For the full list of settings and their values, see Settings.

integreat_cms.core.docker_settings.DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'integreat', 'PASSWORD': 'password', 'PORT': '5433', 'USER': 'integreat'}}[source]

A dictionary containing the settings for all databases to be used with this Django installation (see DATABASES)

{
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'HOST': 'localhost',
        'NAME': 'integreat',
        'PASSWORD': 'password',
        'PORT': '5433',
        'USER': 'integreat',
    },
}

Logging Formatter

class integreat_cms.core.logging_formatter.ColorFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

Logging Formatter to add colors

COLORS: Final[dict[int, int]] = {10: 36, 20: 34, 25: 32, 30: 33, 40: 31, 50: 31}[source]

The bash color codes for the different logging levels

__init__(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Initialize the formatter with specified format strings.

Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.

Use a style parameter of ‘%’, ‘{’ or ‘$’ to specify that you want to use one of %-formatting, str.format() ({}) formatting or string.Template formatting in your format string.

Changed in version 3.2: Added the style parameter.

converter()[source]
localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,

tm_sec,tm_wday,tm_yday,tm_isdst)

Convert seconds since the Epoch to a time tuple expressing local time. When ‘seconds’ is not passed in, convert the current time instead.

default_msec_format = '%s,%03d'[source]
default_time_format = '%Y-%m-%d %H:%M:%S'[source]
format(record: LogRecord) str[source]

Format the specified record as colored text (see logging.Formatter.format()).

Parameters:

record (LogRecord) – The log record

Returns:

The formatted logging message

Return type:

str

formatException(ei)[source]

Format and return the specified exception information as a string.

This default implementation just uses traceback.print_exception()

formatMessage(record)[source]
formatStack(stack_info)[source]

This method is provided as an extension point for specialized formatting of stack information.

The input data is a string as returned from a call to traceback.print_stack(), but with the last trailing newline removed.

The base implementation just returns the value passed in.

formatTime(record, datefmt=None)[source]

Return the creation time of the specified LogRecord as formatted text.

This method should be called from format() by a formatter which wants to make use of a formatted time. This method can be overridden in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used. The resulting string is returned. This function uses a user-configurable function to convert the creation time to a tuple. By default, time.localtime() is used; to change this for a particular formatter instance, set the ‘converter’ attribute to a function with the same signature as time.localtime() or time.gmtime(). To change it for all formatters, for example if you want all logging times to be shown in GMT, set the ‘converter’ attribute in the Formatter class.

usesTime()[source]

Check if the format uses the creation time of the record.

class integreat_cms.core.logging_formatter.RequestFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

Logging Formatter to log the GET parameters of a failed HTTP request

__init__(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Initialize the formatter with specified format strings.

Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.

Use a style parameter of ‘%’, ‘{’ or ‘$’ to specify that you want to use one of %-formatting, str.format() ({}) formatting or string.Template formatting in your format string.

Changed in version 3.2: Added the style parameter.

converter()[source]
localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,

tm_sec,tm_wday,tm_yday,tm_isdst)

Convert seconds since the Epoch to a time tuple expressing local time. When ‘seconds’ is not passed in, convert the current time instead.

default_msec_format = '%s,%03d'[source]
default_time_format = '%Y-%m-%d %H:%M:%S'[source]
format(record: LogRecord) str[source]

Format the specified record including the request if possible (see logging.Formatter.format()).

Parameters:

record (LogRecord) – The log record

Returns:

The formatted logging message

Return type:

str

formatException(ei)[source]

Format and return the specified exception information as a string.

This default implementation just uses traceback.print_exception()

formatMessage(record)[source]
formatStack(stack_info)[source]

This method is provided as an extension point for specialized formatting of stack information.

The input data is a string as returned from a call to traceback.print_stack(), but with the last trailing newline removed.

The base implementation just returns the value passed in.

formatTime(record, datefmt=None)[source]

Return the creation time of the specified LogRecord as formatted text.

This method should be called from format() by a formatter which wants to make use of a formatted time. This method can be overridden in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used. The resulting string is returned. This function uses a user-configurable function to convert the creation time to a tuple. By default, time.localtime() is used; to change this for a particular formatter instance, set the ‘converter’ attribute to a function with the same signature as time.localtime() or time.gmtime(). To change it for all formatters, for example if you want all logging times to be shown in GMT, set the ‘converter’ attribute in the Formatter class.

usesTime()[source]

Check if the format uses the creation time of the record.

Settings

Django settings for integreat-cms.

This file only contains the options which deviate from the default values. For the full list of settings and their values, see Settings.

For production use, some of the settings can be set with environment variables (use the prefix INTEGREAT_CMS_) or via the config file /etc/integreat-cms.ini. See Production Server for details.

integreat_cms.core.settings.ADMINS: Final[list[tuple[str, str]]] = [('Integreat Helpdesk', 'tech@integreat-app.de')][source]

A list of all the people who get code error notifications. When DEBUG is False, Django emails these people the details of exceptions raised in the request/response cycle.

[('Integreat Helpdesk', 'tech@integreat-app.de')]
integreat_cms.core.settings.ALLOWED_HOSTS: Final[list[str]] = ['localhost', '.localhost', '127.0.0.1', '[::1]'][source]

This is a security measure to prevent HTTP Host header attacks, which are possible even under many seemingly-safe web server configurations (see ALLOWED_HOSTS and Host header validation)

['localhost', '.localhost', '127.0.0.1', '[::1]']
integreat_cms.core.settings.API_EVENTS_MAX_TIME_SPAN_DAYS: Final[int] = 31[source]

The time span up to which recurrent events should be returned by the api

integreat_cms.core.settings.AUTHENTICATION_BACKENDS: Final[tuple[str, ...]] = ('rules.permissions.ObjectPermissionBackend', 'django.contrib.auth.backends.ModelBackend', 'integreat_cms.core.authentication_backends.EmailAuthenticationBackend')[source]

A list of authentication backend classes (as strings) to use when attempting to authenticate a user (see AUTHENTICATION_BACKENDS and Other authentication sources)

(
    'rules.permissions.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
    'integreat_cms.core.authentication_backends.EmailAuthenticationBackend',
)
integreat_cms.core.settings.AUTHOR_CHAT_HISTORY_DAYS: Final[int] = 30[source]

How many days of chat history should be shown

integreat_cms.core.settings.AUTH_PASSWORD_VALIDATORS: Final[list[dict[str, str]]] = [{'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'}][source]

The list of validators that are used to check the strength of user’s passwords (see AUTH_PASSWORD_VALIDATORS and Password validation)

[
    {
        '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',
    },
]
integreat_cms.core.settings.AUTH_USER_MODEL: Final[str] = 'cms.User'[source]

The model to use to represent a User (see AUTH_USER_MODEL and Substituting a custom User model)

integreat_cms.core.settings.AVAILABLE_BRANDINGS: Final[dict[str, str]] = {'aschaffenburg': 'hallo aschaffenburg', 'integreat': 'Integreat', 'malte': 'MALTE', 'netzwerk-obdach': 'Netzwerk Obdach & Wohnen'}[source]

The available inbuilt brandings of the CMS

{
    'aschaffenburg': 'hallo aschaffenburg',
    'integreat': 'Integreat',
    'malte': 'MALTE',
    'netzwerk-obdach': 'Netzwerk Obdach & Wohnen',
}
integreat_cms.core.settings.AVAILABLE_LANGUAGES: Final[dict[str, Promise]] = {'de': 'German', 'en': 'English', 'nl': 'Dutch'}[source]

A list of all available languages with locale files for translated strings

{'de': 'German', 'en': 'English', 'nl': 'Dutch'}
integreat_cms.core.settings.BASE_DIR: Final[str] = '/home/circleci/project/integreat_cms'[source]

Build paths inside the project like this: os.path.join(BASE_DIR, ...)

integreat_cms.core.settings.BASE_URL: Final[str] = 'http://localhost:8000'[source]

Needed for webauthn (this is a setting in case the application runs behind a proxy). Used in the following views:

integreat_cms.core.settings.BLOG_URLS: Final[dict[str, str]] = {'de': 'https://integreat-app.de/blog/', 'en': 'https://integreat-app.de/en/blog/'}[source]

URLs to the Integreat blog

{
    'de': 'https://integreat-app.de/blog/',
    'en': 'https://integreat-app.de/en/blog/',
}
integreat_cms.core.settings.BRANDING: Final[str] = 'integreat'[source]

The branding of the CMS

integreat_cms.core.settings.BRANDING_TITLE: Final[str] = 'Integreat'[source]

The readable title of the branding

integreat_cms.core.settings.CACHEOPS: Final[dict[str, dict[str, str]]] = {'*.*': {}, 'auth.*': {'ops': 'all'}, 'cms.*': {'ops': 'all'}, 'linkcheck.*': {'ops': 'all'}}[source]

Which database tables should be cached

{
    '*.*': {},
    'auth.*': {'ops': 'all'},
    'cms.*': {'ops': 'all'},
    'linkcheck.*': {'ops': 'all'},
}
integreat_cms.core.settings.CACHEOPS_DEFAULTS: Final[dict[str, int]] = {'timeout': 3600}[source]

Default cache timeout for cacheops

{'timeout': 3600}
integreat_cms.core.settings.CACHEOPS_DEGRADE_ON_FAILURE: Final[bool] = True[source]

Degrade gracefully on redis fail

integreat_cms.core.settings.CACHES: dict[str, dict[str, str | dict[str, str | bool]]] = {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}[source]

Configuration for caches (see CACHES and Django’s cache framework). Use a LocMemCache for development and a RedisCache whenever available.

{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}
integreat_cms.core.settings.COMPANY: Final[str] = 'Tür an Tür Digitalfabrik gGmbH'[source]

The company operating this CMS

integreat_cms.core.settings.COMPANY_URL: Final[str] = 'https://tuerantuer.de/digitalfabrik/'[source]

The URL to the company’s website

integreat_cms.core.settings.CORS_ALLOW_HEADERS: Final[list[str]] = ['accept', 'accept-encoding', 'authorization', 'content-type', 'dnt', 'origin', 'user-agent', 'x-csrftoken', 'x-requested-with', 'x-integreat-development'][source]

Extend default headers with development header to differentiate dev traffic in statistics (see django-cors-headers/)

[
    'accept',
    'accept-encoding',
    'authorization',
    'content-type',
    'dnt',
    'origin',
    'user-agent',
    'x-csrftoken',
    'x-requested-with',
    'x-integreat-development',
]
integreat_cms.core.settings.CORS_ORIGIN_ALLOW_ALL: Final[bool] = True[source]

Allow access to all domains by setting the following variable to True (see django-cors-headers/)

integreat_cms.core.settings.CSRF_FAILURE_VIEW: Final[str] = 'integreat_cms.cms.views.error_handler.csrf_failure'[source]

A dotted path to the view function to be used when an incoming request is rejected by the CSRF protection (see CSRF_FAILURE_VIEW)

integreat_cms.core.settings.CURRENT_TIME_ZONE: Final[str] = 'Europe/Berlin'[source]

A string representing the time zone that is used for rendering

integreat_cms.core.settings.CUSTOM_LOCALE_PATH: Final[str] = '/etc/integreat-cms/locale'[source]

Custom path for additional local translation files

integreat_cms.core.settings.DATABASES: dict[str, dict[str, str]] = {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_HEALTH_CHECKS': False, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'localhost', 'NAME': 'integreat', 'OPTIONS': {}, 'PASSWORD': '', 'PORT': '5432', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'integreat'}}[source]

A dictionary containing the settings for all databases to be used with this Django installation (see DATABASES)

{
    'default': {
        'ATOMIC_REQUESTS': False,
        'AUTOCOMMIT': True,
        'CONN_HEALTH_CHECKS': False,
        'CONN_MAX_AGE': 0,
        'ENGINE': 'django.db.backends.postgresql',
        'HOST': 'localhost',
        'NAME': 'integreat',
        'OPTIONS': {},
        'PASSWORD': '',
        'PORT': '5432',
        'TEST': {
            'CHARSET': None,
            'COLLATION': None,
            'MIGRATE': True,
            'MIRROR': None,
            'NAME': None,
        },
        'TIME_ZONE': None,
        'USER': 'integreat',
    },
}
integreat_cms.core.settings.DEBUG: Final[bool] = False[source]

A boolean that turns on/off debug mode (see DEBUG)

Warning

Never deploy a site into production with DEBUG turned on!

integreat_cms.core.settings.DEBUG_TOOLBAR_PANELS: Final[list[str]] = ['debug_toolbar.panels.timer.TimerPanel', 'debug_toolbar.panels.sql.SQLPanel', 'debug_toolbar.panels.cache.CachePanel', 'debug_toolbar.panels.signals.SignalsPanel', 'debug_toolbar.panels.templates.TemplatesPanel', 'debug_toolbar.panels.staticfiles.StaticFilesPanel', 'debug_toolbar.panels.logging.LoggingPanel', 'debug_toolbar.panels.redirects.RedirectsPanel', 'debug_toolbar.panels.profiling.ProfilingPanel', 'debug_toolbar.panels.request.RequestPanel', 'debug_toolbar.panels.headers.HeadersPanel', 'debug_toolbar.panels.history.HistoryPanel', 'debug_toolbar.panels.settings.SettingsPanel'][source]

This setting specifies the full Python path to each panel that you want included in the toolbar. (see Configuration)

[
    'debug_toolbar.panels.timer.TimerPanel',
    'debug_toolbar.panels.sql.SQLPanel',
    'debug_toolbar.panels.cache.CachePanel',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.templates.TemplatesPanel',
    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.redirects.RedirectsPanel',
    'debug_toolbar.panels.profiling.ProfilingPanel',
    'debug_toolbar.panels.request.RequestPanel',
    'debug_toolbar.panels.headers.HeadersPanel',
    'debug_toolbar.panels.history.HistoryPanel',
    'debug_toolbar.panels.settings.SettingsPanel',
]
integreat_cms.core.settings.DEEPL_API_URL: Final[str | None] = None[source]

The URL to DeepL API. If not set, the library selects the correct URL automatically

integreat_cms.core.settings.DEEPL_AUTH_KEY: str | None = None[source]

Authentication token for the DeepL API. If not set, automatic translations via DeepL are disabled

integreat_cms.core.settings.DEEPL_ENABLED: bool = False[source]

Whether automatic translations via DeepL are enabled. This is True if DEEPL_AUTH_KEY is set, False otherwise.

integreat_cms.core.settings.DEFAULT_AUTO_FIELD: Final[str] = 'django.db.models.BigAutoField'[source]

Default primary key field type to use for models that don’t have a field with primary_key=True. (see DEFAULT_AUTO_FIELD)

integreat_cms.core.settings.DEFAULT_BLOG_URL: Final[str] = 'https://integreat-app.de/en/blog/'[source]

The blog URL to use when the blog is not available in the requested language

integreat_cms.core.settings.DEFAULT_BOUNDING_BOX: Final[BoundingBox] = <BoundingBox(longitude_min: 5.98865807458, latitude_min: 47.3024876979, longitude_max: 15.0169958839, latitude_max: 54.983104153])>[source]

The default bounding box for regions with indistinct borders

integreat_cms.core.settings.DEFAULT_FROM_EMAIL: Final[str] = 'keineantwort@integreat-app.de'[source]

Default email address to use for various automated correspondence from the site manager(s) (see DEFAULT_FROM_EMAIL)

integreat_cms.core.settings.DEFAULT_LANGUAGES: Final[list[str]] = ['de', 'en'][source]

The default UI languages

['de', 'en']
integreat_cms.core.settings.DEFAULT_REQUEST_TIMEOUT: Final[int] = 10[source]

The default timeout in seconds for retrieving external APIs etc.

integreat_cms.core.settings.DEFAULT_RSS_FEED_URL: Final[str] = 'https://integreat-app.de/en/feed/'[source]

The RSS feed URL to use when the feed is not available in the requested language

integreat_cms.core.settings.DEPS_LOG_LEVEL: Final[str] = 'WARN'[source]

The log level for dependencies

integreat_cms.core.settings.EMAIL_BACKEND: Final[str] = 'django.core.mail.backends.smtp.EmailBackend'[source]

The backend to use for sending emails (see EMAIL_BACKEND and Sending email)

integreat_cms.core.settings.EMAIL_HOST: Final[str] = 'localhost'[source]

The host to use for sending email (see EMAIL_HOST)

integreat_cms.core.settings.EMAIL_HOST_PASSWORD: Final[str | None] = None[source]

Password to use for the SMTP server defined in EMAIL_HOST (see EMAIL_HOST_PASSWORD). If empty, Django won’t attempt authentication.

integreat_cms.core.settings.EMAIL_HOST_USER: Final[str] = 'keineantwort@integreat-app.de'[source]

Username to use for the SMTP server defined in EMAIL_HOST (see EMAIL_HOST_USER). If empty, Django won’t attempt authentication.

integreat_cms.core.settings.EMAIL_PORT: Final[int] = 587[source]

Port to use for the SMTP server defined in EMAIL_HOST (see EMAIL_PORT)

integreat_cms.core.settings.EMAIL_USE_SSL: Final[bool] = False[source]

Whether to use an implicit TLS (secure) connection when talking to the SMTP server. In most email documentation this type of TLS connection is referred to as SSL. It is generally used on port 465. (see EMAIL_USE_SSL)

integreat_cms.core.settings.EMAIL_USE_TLS: Final[bool] = True[source]

Whether to use a TLS (secure) connection when talking to the SMTP server. This is used for explicit TLS connections, generally on port 587. (see EMAIL_USE_TLS)

integreat_cms.core.settings.EXTERNAL_CALENDAR_CATEGORY: Final[str] = 'integreat'[source]

The tag that events from external calendars need to get imported

integreat_cms.core.settings.FCM_CHANNELS: Final[tuple[tuple[str, Promise], ...]] = (('news', 'News'),)[source]

The available push notification channels

(('news', 'News'), )
integreat_cms.core.settings.FCM_CREDENTIALS: str | None = None[source]

Path to the saved credential json file

integreat_cms.core.settings.FCM_DATA_URL: Final[str] = 'https://fcmdata.googleapis.com/v1beta1/projects/integreat-2020/androidApps/1:164298278764:android:3fc1f67f3883df306fd549/deliveryData'[source]

FCM Data API Url

integreat_cms.core.settings.FCM_ENABLED: bool = False[source]

Whether push notifications via Firebase are enabled. This is True if FCM_CREDENTIALS is set, False otherwise.

integreat_cms.core.settings.FCM_HISTORY_DAYS: Final[int] = 28[source]

How many days push notifications are shown in the apps

integreat_cms.core.settings.FCM_NOTIFICATION_RETAIN_TIME_IN_HOURS: Final[int] = 24[source]

Duration (in hours) that we retain pending push notifications for retry attempts before discarding them

integreat_cms.core.settings.FCM_SCHEDULE_INTERVAL_MINUTES: Final[int] = 60[source]

The interval at which scheduled push notifications are sent out Must be <= 60 and a divisor of 60

integreat_cms.core.settings.FCM_URL: Final[str] = 'https://fcm.googleapis.com/v1/projects/integreat-2020/messages:send'[source]

FCM API Url

integreat_cms.core.settings.FORMAT_MODULE_PATH: Final[list[str]] = ['integreat_cms.core.formats'][source]

A full Python path to a Python package that contains custom format definitions for project locales. (see FORMAT_MODULE_PATH)

['integreat_cms.core.formats']
integreat_cms.core.settings.GOOGLE_APPLICATION_CREDENTIALS: str | None = None[source]

Path to the saved credential json file

integreat_cms.core.settings.GOOGLE_PARENT_PARAM: Final[str] = 'projects/None/locations/global'[source]

parent parameter for Google Translate, consists of project id and location

integreat_cms.core.settings.GOOGLE_PROJECT_ID: str | None = None[source]

Google project id

integreat_cms.core.settings.GOOGLE_TRANSLATE_ENABLED: bool = False[source]

This is True when both the credentials and project id are provided

integreat_cms.core.settings.GOOGLE_TRANSLATE_LOCATION: str = 'global'[source]

Location for google translate. Default to “global”. This must be non-global for custom glossaries.

integreat_cms.core.settings.GOOGLE_TRANSLATE_VERSION: str = 'Basic'[source]

Version of Google Translate, either Basic or Advanced

integreat_cms.core.settings.GVZ_API_ENABLED: Final[bool] = True[source]

Whether or not the GVZ (Gemeindeverzeichnis) API is enabled. This is used to automatically import coordinates and region aliases (see gvz_api for more information).

integreat_cms.core.settings.GVZ_API_URL: Final[str] = 'https://gvz.integreat-app.de'[source]

The URL to our GVZ (Gemeindeverzeichnis) API. This is used to automatically import coordinates and region aliases (see gvz_api for more information).

integreat_cms.core.settings.HIX_REQUIRED_FOR_MT: Final[float] = 15.0[source]

The minimum HIX score required for machine translation

integreat_cms.core.settings.HOSTNAME: Final[str | None] = 'localhost'[source]

Needed for webauthn (this is a setting in case the application runs behind a proxy). Used in the following views:

integreat_cms.core.settings.IMPRINT_SLUG: Final[str] = 'disclaimer'[source]

The slug for the legal notice (see e.g. ImprintPageTranslation)

integreat_cms.core.settings.INSTALLED_APPS: Final[list[str]] = ['integreat_cms.cms', 'integreat_cms.core', 'integreat_cms.deepl_api', 'integreat_cms.google_translate_api', 'integreat_cms.firebase_api', 'integreat_cms.gvz_api', 'integreat_cms.matomo_api', 'integreat_cms.nominatim_api', 'integreat_cms.summ_ai_api', 'integreat_cms.textlab_api', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sitemaps', 'django.contrib.staticfiles', 'corsheaders', 'db_mutex', 'import_export', 'linkcheck', 'polymorphic', 'rules.apps.AutodiscoverRulesConfig', 'treebeard', 'webpack_loader', 'widget_tweaks'][source]

Enabled applications (see INSTALLED_APPS)

[
    'integreat_cms.cms',
    'integreat_cms.core',
    'integreat_cms.deepl_api',
    'integreat_cms.google_translate_api',
    'integreat_cms.firebase_api',
    'integreat_cms.gvz_api',
    'integreat_cms.matomo_api',
    'integreat_cms.nominatim_api',
    'integreat_cms.summ_ai_api',
    'integreat_cms.textlab_api',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.humanize',
    'django.contrib.messages',
    'django.contrib.sessions',
    'django.contrib.sitemaps',
    'django.contrib.staticfiles',
    'corsheaders',
    'db_mutex',
    'import_export',
    'linkcheck',
    'polymorphic',
    'rules.apps.AutodiscoverRulesConfig',
    'treebeard',
    'webpack_loader',
    'widget_tweaks',
]
integreat_cms.core.settings.INTERNAL_IPS: Final[list[str]] = ['localhost', '127.0.0.1'][source]

A list of IP addresses, as strings, that allow the debug() context processor to add some variables to the template context.

['localhost', '127.0.0.1']
integreat_cms.core.settings.INTERNAL_URLS: Final[list[str]] = ['localhost', '.localhost', '127.0.0.1', '[::1]', 'https://integreat.app', 'https://integreat-app.de'][source]

The URLs which are treated as internal in TinyMCE custom link plugin

[
    'localhost',
    '.localhost',
    '127.0.0.1',
    '[::1]',
    'https://integreat.app',
    'https://integreat-app.de',
]
integreat_cms.core.settings.LANGUAGES: Final[list[tuple[str, Promise]]] = [('de', 'German'), ('en', 'English')][source]

The list of languages which are available in the UI (see LANGUAGES and Internationalization and localization)

[('de', 'German'), ('en', 'English')]
integreat_cms.core.settings.LANGUAGE_CODE: Final[str] = 'de'[source]

A string representing the language slug for this installation (see LANGUAGE_CODE and Internationalization and localization)

integreat_cms.core.settings.LEGACY_FILE_UPLOAD: Final[bool] = False[source]

Enables the possibility to upload further file formats (e.g. DOC, GIF).

integreat_cms.core.settings.LINKCHECK_COMMAND_RUNNING: Final[bool] = False[source]

Whether archived pages should be ignored for linkcheck scan. Since this causes a lot of overhead, only use this for the findlinks management command:

$ INTEGREAT_CMS_LINKCHECK_COMMAND_RUNNING=1 integreat-cms-cli findlinks
integreat_cms.core.settings.LINKCHECK_DISABLE_LISTENERS: bool = False[source]

Disable linkcheck listeners e.g. when the fixtures are loaded

integreat_cms.core.settings.LINKCHECK_EMAIL_ENABLED: Final[bool] = True[source]

Wheter email links are enabled

integreat_cms.core.settings.LINKCHECK_IGNORED_URL_TYPES: Final[list[str]] = [][source]

URL types that are not supposed to be shown in the link list (e.g. phone numbers and emails)

[]
integreat_cms.core.settings.LINKCHECK_MAX_URL_LENGTH: Final[int] = 1024[source]

The maximum length of URLs which can be checked. Longer URLs will be silently ignored.

integreat_cms.core.settings.LINKCHECK_PHONE_ENABLED: Final[bool] = True[source]

Wheter phone links are enabled

integreat_cms.core.settings.LINKCHECK_SITE_DOMAINS: Final[list[str]] = ['https://integreat.app', 'http://localhost:8000'][source]

Used by django-linkcheck to determine whether a link is internal.

['https://integreat.app', 'http://localhost:8000']
integreat_cms.core.settings.LOCALE_PATHS: Final[list[str]] = ['/home/circleci/project/integreat_cms/locale', '/etc/integreat-cms/locale'][source]

A list of directories where Django looks for translation files (see LOCALE_PATHS and Internationalization and localization)

['/home/circleci/project/integreat_cms/locale', '/etc/integreat-cms/locale']
integreat_cms.core.settings.LOGFILE: Final[str] = '/home/circleci/project/integreat_cms/integreat-cms.log'[source]

The file path of the logfile. Needs to be writable by the application.

integreat_cms.core.settings.LOGGING: dict[str, Any] = {'disable_existing_loggers': False, 'filters': {'only_stdout': {'()': 'django.utils.log.CallbackFilter', 'callback': <function <lambda>>}, 'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}, 'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}}, 'formatters': {'console': {'()': <class 'integreat_cms.core.logging_formatter.RequestFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} \x1b[1m{levelname}\x1b[0m {name} - {message}', 'style': '{'}, 'console-colored': {'()': <class 'integreat_cms.core.logging_formatter.ColorFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname} {name} - {message}', 'style': '{'}, 'email': {'datefmt': '%Y-%m-%d %H:%M:%S', 'format': 'Date and time: {asctime}\nSeverity: {levelname}\nLogger: {name}\nMessage: {message}\nFile: {funcName}() in {pathname}:{lineno}', 'style': '{'}, 'logfile': {'()': <class 'integreat_cms.core.logging_formatter.RequestFormatter'>, 'datefmt': '%b %d %H:%M:%S', 'format': '{asctime} {levelname:7} {name} - {message}', 'style': '{'}, 'management-command': {'()': <class 'integreat_cms.core.logging_formatter.ColorFormatter'>, 'format': '{message}', 'style': '{'}, 'syslog': {'format': 'INTEGREAT CMS - {levelname}: {message}', 'style': '{'}}, 'handlers': {'authlog': {'address': '/dev/log', 'class': 'logging.handlers.SysLogHandler', 'facility': 'auth', 'filters': ['require_debug_false'], 'formatter': 'syslog'}, 'console': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'console'}, 'console-colored': {'class': 'logging.StreamHandler', 'filters': ['require_debug_true'], 'formatter': 'console-colored'}, 'logfile': {'class': 'logging.FileHandler', 'filename': '/home/circleci/project/integreat_cms/integreat-cms.log', 'formatter': 'logfile'}, 'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false'], 'formatter': 'email', 'level': 'ERROR'}, 'management-command-stderr': {'class': 'logging.StreamHandler', 'formatter': 'management-command', 'level': 'WARNING'}, 'management-command-stdout': {'class': 'logging.StreamHandler', 'filters': ['only_stdout'], 'formatter': 'management-command', 'level': 'DEBUG', 'stream': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>}, 'syslog': {'address': '/dev/log', 'class': 'logging.handlers.SysLogHandler', 'facility': 'syslog', 'filters': ['require_debug_false']}}, 'loggers': {'PIL': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'aiohttp.client': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'auth': {'handlers': ['console', 'logfile', 'authlog', 'syslog'], 'level': 'INFO'}, 'deepl': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'django': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'geopy': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'integreat_cms': {'handlers': ['console-colored', 'logfile'], 'level': 'INFO'}, 'integreat_cms.core.management.commands': {'handlers': ['management-command-stdout', 'management-command-stderr', 'logfile'], 'level': 'INFO', 'propagate': False}, 'linkcheck': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'requests': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'rules': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'urllib3': {'handlers': ['console', 'logfile'], 'level': 'WARN'}, 'xhtml2pdf': {'handlers': ['console', 'logfile'], 'level': 'WARN'}}, 'version': 1}[source]

Logging configuration dictionary (see LOGGING)

{
    'disable_existing_loggers': False,
    'filters': {
        'only_stdout': {
            '()': 'django.utils.log.CallbackFilter',
            'callback': <function <lambda> at 0x7f41a0fb4cc0>,
        },
        'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'},
        'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'},
    },
    'formatters': {
        'console': {
            '()': <class 'integreat_cms.core.logging_formatter.RequestFormatter'>,
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} \x1b[1m{levelname}\x1b[0m {name} - {message}',
            'style': '{',
        },
        'console-colored': {
            '()': <class 'integreat_cms.core.logging_formatter.ColorFormatter'>,
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} {levelname} {name} - {message}',
            'style': '{',
        },
        'email': {
            'datefmt': '%Y-%m-%d %H:%M:%S',
            'format': 'Date and time: {asctime}\nSeverity: {levelname}\nLogger: {name}\nMessage: {message}\nFile: {funcName}() in {pathname}:{lineno}',
            'style': '{',
        },
        'logfile': {
            '()': <class 'integreat_cms.core.logging_formatter.RequestFormatter'>,
            'datefmt': '%b %d %H:%M:%S',
            'format': '{asctime} {levelname:7} {name} - {message}',
            'style': '{',
        },
        'management-command': {
            '()': <class 'integreat_cms.core.logging_formatter.ColorFormatter'>,
            'format': '{message}',
            'style': '{',
        },
        'syslog': {
            'format': 'INTEGREAT CMS - {levelname}: {message}',
            'style': '{',
        },
    },
    'handlers': {
        'authlog': {
            'address': '/dev/log',
            'class': 'logging.handlers.SysLogHandler',
            'facility': 'auth',
            'filters': ['require_debug_false'],
            'formatter': 'syslog',
        },
        'console': {
            'class': 'logging.StreamHandler',
            'filters': ['require_debug_true'],
            'formatter': 'console',
        },
        'console-colored': {
            'class': 'logging.StreamHandler',
            'filters': ['require_debug_true'],
            'formatter': 'console-colored',
        },
        'logfile': {
            'class': 'logging.FileHandler',
            'filename': '/home/circleci/project/integreat_cms/integreat-cms.log',
            'formatter': 'logfile',
        },
        'mail_admins': {
            'class': 'django.utils.log.AdminEmailHandler',
            'filters': ['require_debug_false'],
            'formatter': 'email',
            'level': 'ERROR',
        },
        'management-command-stderr': {
            'class': 'logging.StreamHandler',
            'formatter': 'management-command',
            'level': 'WARNING',
        },
        'management-command-stdout': {
            'class': 'logging.StreamHandler',
            'filters': ['only_stdout'],
            'formatter': 'management-command',
            'level': 'DEBUG',
            'stream': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>,
        },
        'syslog': {
            'address': '/dev/log',
            'class': 'logging.handlers.SysLogHandler',
            'facility': 'syslog',
            'filters': ['require_debug_false'],
        },
    },
    'loggers': {
        'PIL': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'aiohttp.client': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'auth': {'handlers': ['console', 'logfile', 'authlog', 'syslog'], 'level': 'INFO'},
        'deepl': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'django': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'geopy': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'integreat_cms': {'handlers': ['console-colored', 'logfile'], 'level': 'INFO'},
        'integreat_cms.core.management.commands': {
            'handlers': [
                'management-command-stdout',
                'management-command-stderr',
                'logfile',
            ],
            'level': 'INFO',
            'propagate': False,
        },
        'linkcheck': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'requests': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'rules': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'urllib3': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
        'xhtml2pdf': {'handlers': ['console', 'logfile'], 'level': 'WARN'},
    },
    'version': 1,
}
integreat_cms.core.settings.LOGIN_REDIRECT_URL: Final[str] = '/'[source]

The URL where requests are redirected after login (see LOGIN_REDIRECT_URL)

integreat_cms.core.settings.LOGIN_URL: Final[str] = '/login/'[source]

The URL where requests are redirected for login (see LOGIN_URL)

integreat_cms.core.settings.LOGOUT_REDIRECT_URL: Final[str] = '/login/'[source]

The URL where requests are redirected after logout (see LOGOUT_REDIRECT_URL)

integreat_cms.core.settings.LOG_LEVEL: str = 'INFO'[source]

The log level for integreat-cms django apps

integreat_cms.core.settings.MATOMO_TRACKING: Final[bool] = False[source]

Enable tracking of API requests in Matomo

integreat_cms.core.settings.MATOMO_URL: Final[str] = 'https://statistics.integreat-app.de'[source]

The URL to the Matomo statistics server.

integreat_cms.core.settings.MAX_EVENT_DURATION: Final[int] = 28[source]

The maximum duration of an event

integreat_cms.core.settings.MEDIA_MAX_UPLOAD_SIZE: Final[int] = 3145728[source]

The maximum size of media files in bytes

integreat_cms.core.settings.MEDIA_OPTIMIZED_SIZE: Final[int] = 3000[source]

The maximum size of media images in pixels (larger images will automatically be resized)

integreat_cms.core.settings.MEDIA_ROOT: Final[str] = '/home/circleci/project/integreat_cms/media'[source]

Absolute filesystem path to the directory that will hold user-uploaded files (see MEDIA_ROOT)

integreat_cms.core.settings.MEDIA_THUMBNAIL_CROP: Final[bool] = False[source]

Whether thumbnails should be cropped (resulting in square thumbnails regardless of the aspect ratio of the image)

integreat_cms.core.settings.MEDIA_THUMBNAIL_SIZE: Final[int] = 300[source]

The maximum size of media thumbnails in pixels

integreat_cms.core.settings.MEDIA_URL: Final[str] = '/media/'[source]

URL that handles the media served from MEDIA_ROOT (see MEDIA_URL)

integreat_cms.core.settings.MESSAGE_LOGGING_ENABLED: bool = False[source]

Whether to log all entries from the messages framework

integreat_cms.core.settings.MESSAGE_STORAGE: Final[str] = 'integreat_cms.core.storages.MessageLoggerStorage'[source]

A custom message store for logging (see MESSAGE_STORAGE)

integreat_cms.core.settings.MIDDLEWARE: list[str] = ['django.middleware.gzip.GZipMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'integreat_cms.core.middleware.RegionMiddleware', 'integreat_cms.core.middleware.AccessControlMiddleware', 'integreat_cms.core.middleware.TimezoneMiddleware'][source]

Activated middlewares (see MIDDLEWARE)

[
    'django.middleware.gzip.GZipMiddleware',
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'integreat_cms.core.middleware.RegionMiddleware',
    'integreat_cms.core.middleware.AccessControlMiddleware',
    'integreat_cms.core.middleware.TimezoneMiddleware',
]
integreat_cms.core.settings.MT_CREDITS_ADDON: Final[int] = 1000000[source]

An integer specifying the number of translation credits that can be bought as an add-on

integreat_cms.core.settings.MT_CREDITS_FREE: Final[int] = 50000[source]

An integer specifying the number of translation credits available to regions for free

integreat_cms.core.settings.MT_SOFT_MARGIN: Final[int] = 500[source]

The actual number of words which are used as soft margin

integreat_cms.core.settings.MT_SOFT_MARGIN_FRACTION: Final[float] = 0.01[source]

A floating point that specifies the percentage of MT_CREDITS_FREE used as a soft margin

integreat_cms.core.settings.NOMINATIM_API_ENABLED: Final[bool] = True[source]

Whether or not the Nominatim API for OpenStreetMap queries is enabled. This is used to automatically derive coordinates from addresses.

integreat_cms.core.settings.NOMINATIM_API_URL: Final[str] = 'http://nominatim.maps.tuerantuer.org/nominatim/'[source]

The URL to our Nominatim API. This is used to automatically derive coordinates from addresses.

integreat_cms.core.settings.NUM_REGIONS_QUICK_ACCESS: Final[int] = 15[source]

The number of regions that are available via the dropdown

integreat_cms.core.settings.OUTDATED_THRESHOLD_DAYS: Final[int] = 365[source]

Days after which a page is considered to be outdated in the todo dashboard

integreat_cms.core.settings.PDF_DEACTIVATED_LANGUAGES: Final[str | list[str]] = [][source]

Slugs of languages for which PDF export should be deactivated

[]
integreat_cms.core.settings.PDF_ROOT: Final[str] = '/home/circleci/project/integreat_cms/pdf'[source]

The directory where PDF files are stored

integreat_cms.core.settings.PDF_URL: Final[str] = '/pdf/'[source]

The URL path where PDF files are served for download

integreat_cms.core.settings.PER_PAGE: Final[int] = 16[source]

Number of entries displayed per pagination chunk see Paginator

integreat_cms.core.settings.REDIS_CACHE: Final[bool] = False[source]

Check whether redis is activated

integreat_cms.core.settings.RELEASE_NOTES_DIRS: Final[str] = '/home/circleci/project/integreat_cms/release_notes'[source]

Where release notes are stored

integreat_cms.core.settings.RESERVED_REGION_PAGE_PATTERNS: Final[list[str]] = ['disclaimer', 'news', 'events', 'locations', 'offers', 'search'][source]

Reserved region page patterns

['disclaimer', 'news', 'events', 'locations', 'offers', 'search']
integreat_cms.core.settings.RESERVED_REGION_SLUGS: Final[list[str]] = ['landing', 'recommend', 'licenses', 'main-disclaimer', 'jpal', 'not-found', 'consent'][source]

Reserved region slugs, that are used in the webapp

[
    'landing',
    'recommend',
    'licenses',
    'main-disclaimer',
    'jpal',
    'not-found',
    'consent',
]
integreat_cms.core.settings.ROOT_URLCONF: Final[str] = 'integreat_cms.core.urls'[source]

Default URL dispatcher (see ROOT_URLCONF)

integreat_cms.core.settings.RSS_FEED_URLS: Final[dict[str, str]] = {'de': 'https://integreat-app.de/feed/', 'en': 'https://integreat-app.de/en/feed/'}[source]

RSS feed URLs to the Integreat blog

{
    'de': 'https://integreat-app.de/feed/',
    'en': 'https://integreat-app.de/en/feed/',
}
integreat_cms.core.settings.SECRET_KEY: str = ''[source]

The secret key for this particular Django installation (see SECRET_KEY)

Warning

Provide a key via the environment variable INTEGREAT_CMS_SECRET_KEY in production and keep it secret!

integreat_cms.core.settings.SERIALIZATION_MODULES: Final[dict[str, str]] = {'xliff': 'integreat_cms.xliff.generic_serializer', 'xliff-1.2': 'integreat_cms.xliff.xliff1_serializer', 'xliff-2.0': 'integreat_cms.xliff.xliff2_serializer'}[source]

A dictionary of modules containing serializer definitions (provided as strings), keyed by a string identifier for that serialization type (see SERIALIZATION_MODULES).

{
    'xliff': 'integreat_cms.xliff.generic_serializer',
    'xliff-1.2': 'integreat_cms.xliff.xliff1_serializer',
    'xliff-2.0': 'integreat_cms.xliff.xliff2_serializer',
}
integreat_cms.core.settings.SERVER_EMAIL: Final[str] = 'keineantwort@integreat-app.de'[source]

The email address that error messages come from, such as those sent to ADMINS. (see SERVER_EMAIL)

The URL to a domain that handles short links. This is currently the same as BASE_URL but will change in the future.

integreat_cms.core.settings.SITE_DOMAIN: Final[str] = 'https://integreat.app'[source]

An alias of WEBAPP_URL. Used by django-linkcheck to determine whether a link is internal.

integreat_cms.core.settings.SOCIAL_PREVIEW_IMAGE: Final[str] = 'static/logos/integreat/social-media-preview.png'[source]

Social media preview image

integreat_cms.core.settings.STATICFILES_DIRS: Final[list[str]] = ['/home/circleci/project/integreat_cms/static/dist'][source]

This setting defines the additional locations the django.contrib.staticfiles app will traverse to collect static files for deployment or to serve them during development (see STATICFILES_DIRS and Managing static files).

['/home/circleci/project/integreat_cms/static/dist']
integreat_cms.core.settings.STATICFILES_FINDERS: Final[tuple[str, ...]] = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder')[source]

The list of finder backends that know how to find static files in various locations (see STATICFILES_FINDERS)

(
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
integreat_cms.core.settings.STATIC_ROOT: Final[str | None] = None[source]

The absolute path to the output directory where django.contrib.staticfiles will put static files for deployment (see STATIC_ROOT and Managing static files) In debug mode, this is not required since django.contrib.staticfiles can directly serve these files.

integreat_cms.core.settings.STATIC_URL: Final[str] = '/static/'[source]

URL to use in development when referring to static files located in STATICFILES_DIRS (see STATIC_URL and Managing static files)

integreat_cms.core.settings.SUMM_AI_API_KEY: str | None = None[source]

Authentication token for SUMM.AI, If not set, automatic translations to easy german are disabled

integreat_cms.core.settings.SUMM_AI_API_URL: Final[str] = 'https://backend.summ-ai.com/translate/v1/'[source]

The URL to our SUMM.AI API for automatic translations from German into Easy German

integreat_cms.core.settings.SUMM_AI_EASY_GERMAN_LANGUAGE_SLUG: Final[str] = 'de-si'[source]

The language slug for Easy German

integreat_cms.core.settings.SUMM_AI_ENABLED: bool = False[source]

Whether SUMM.AI is enabled or not This is True if SUMM_AI_API_KEY is set, False otherwise.

integreat_cms.core.settings.SUMM_AI_GERMAN_LANGUAGE_SLUG: Final[str] = 'de'[source]

The language slugs for German

integreat_cms.core.settings.SUMM_AI_HTML_FIELDS: Final[list[str]] = ['content'][source]

All HTML fields of the content models which should be translated

['content']
integreat_cms.core.settings.SUMM_AI_HTML_TAGS: Final[list[str]] = ['p', 'li'][source]

Translate all <p> and <li> tags

['p', 'li']
integreat_cms.core.settings.SUMM_AI_INHERITED_FIELDS: Final[list[str]] = ['title'][source]

All fields of the content models which should not be translated, but inherited from the source translation

['title']
integreat_cms.core.settings.SUMM_AI_IS_INITIAL: Final[bool] = True[source]

Value of the is_initial flag

integreat_cms.core.settings.SUMM_AI_MAX_CONCURRENT_REQUESTS = 20[source]

The limit for “Too many requests”.

integreat_cms.core.settings.SUMM_AI_MAX_RETRIES = 5[source]

Maximum amount of retries before giving up Retries are reset if translation requests are successful after completing the cooldown

integreat_cms.core.settings.SUMM_AI_RATE_LIMIT_COOLDOWN = 30.0[source]

Waiting time after “Too many requests” response was sent

integreat_cms.core.settings.SUMM_AI_SEPARATOR: Final[str] = 'hyphen'[source]

The separator which is used to split compound words, e.g. Bundes-Kanzler (hyphen) or Bundes·kanzler (interpunct)

integreat_cms.core.settings.SUMM_AI_TEST_MODE: Final[bool] = False[source]

Whether requests to the SUMM.AI are done with the is_test flag

integreat_cms.core.settings.SUMM_AI_TEXT_FIELDS: Final[list[str]] = ['meta_description'][source]

All plain text fields of the content models which should be translated

['meta_description']
integreat_cms.core.settings.SUMM_AI_TIMEOUT: Final[int] = 10[source]

The timeout in minutes for requests to the SUMM.AI API

integreat_cms.core.settings.SYS_LOG_LEVEL: Final[str] = 'INFO'[source]

The log level for the syslog

integreat_cms.core.settings.TEMPLATES: Final[list[dict[str, str | list | bool | dict[str, list[str] | bool]]]] = [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/home/circleci/project/integreat_cms/api/v3/templates'], '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', 'integreat_cms.core.context_processors.version_processor', 'integreat_cms.core.context_processors.settings_processor', 'integreat_cms.core.context_processors.constants_processor'], 'debug': False}}][source]

Config for HTML templates (see TEMPLATES)

[
    {
        'APP_DIRS': True,
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['/home/circleci/project/integreat_cms/api/v3/templates'],
        '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',
                'integreat_cms.core.context_processors.version_processor',
                'integreat_cms.core.context_processors.settings_processor',
                'integreat_cms.core.context_processors.constants_processor',
            ],
            'debug': False,
        },
    },
]
integreat_cms.core.settings.TEST: Final[bool] = False[source]

Whether this is a testing system (even if DEBUG is off)

integreat_cms.core.settings.TEXTLAB_API_BULK_COOL_DOWN_PERIOD: Final[float] = 60.0[source]

How many seconds we should wait after finishing a region in the bulk management command

integreat_cms.core.settings.TEXTLAB_API_BULK_WAITING_TIME: Final[float] = 0.5[source]

How many seconds we should wait between the requests in the bulk management command

integreat_cms.core.settings.TEXTLAB_API_CONTENT_TYPES: Final[list[str]] = ['pagetranslation'][source]

Which content types are enabled for the Textlab API

['pagetranslation']
integreat_cms.core.settings.TEXTLAB_API_DEFAULT_BENCHMARK_ID: Final[int] = 420[source]

Which text type / benchmark id to default to

integreat_cms.core.settings.TEXTLAB_API_ENABLED: bool = False[source]

Whether the Textlab API is enabled. This is True if TEXTLAB_API_KEY is set, False otherwise.

integreat_cms.core.settings.TEXTLAB_API_KEY: str | None = None[source]

Key for the Textlab API

integreat_cms.core.settings.TEXTLAB_API_LANGUAGES: Final[list[str]] = ['de'][source]

Which language slugs are allowed for the Textlab API

['de']
integreat_cms.core.settings.TEXTLAB_API_URL: Final[str] = 'https://textlab.online/api/'[source]

URL to the Textlab API

integreat_cms.core.settings.TEXTLAB_API_USERNAME: Final[str] = 'Integreat'[source]

Username for the Textlab API

integreat_cms.core.settings.TIME_ZONE: Final[str] = 'UTC'[source]

A string representing the time zone for this installation (see TIME_ZONE and Internationalization and localization)

integreat_cms.core.settings.USER_CHAT_TICKET_GROUP: Final[str] = 'integreat-chat'[source]

Zammad ticket group used for Integreat chat messages

integreat_cms.core.settings.USER_CHAT_WINDOW_LIMIT: Final[int] = 50[source]

Maximum number of requests users are allowed to send within WINDOW_MINUTES minutes

integreat_cms.core.settings.USER_CHAT_WINDOW_MINUTES: Final[int] = 10[source]

Size of the sliding window used for rate limiting

integreat_cms.core.settings.USE_I18N: bool = True[source]

A boolean that specifies whether Django’s translation system should be enabled (see USE_I18N and Internationalization and localization)

integreat_cms.core.settings.USE_L10N: Final[bool] = True[source]

A boolean that specifies if localized formatting of data will be enabled by default or not (see USE_L10N and Internationalization and localization)

integreat_cms.core.settings.USE_TZ: Final[bool] = True[source]

A boolean that specifies if datetimes will be timezone-aware by default or not (see USE_TZ and Internationalization and localization)

integreat_cms.core.settings.WEBAPP_URL: Final[str] = 'https://integreat.app'[source]

The URL to our webapp. This is used for urls in the sitemap.xml (see sitemap for more information).

integreat_cms.core.settings.WEBPACK_LOADER: Final[dict[str, dict[str, str]]] = {'DEFAULT': {'BUNDLE_DIR_NAME': '', 'STATS_FILE': '/home/circleci/project/integreat_cms/webpack-stats.json'}}[source]

Overwrite default bundle directory

{
    'DEFAULT': {
        'BUNDLE_DIR_NAME': '',
        'STATS_FILE': '/home/circleci/project/integreat_cms/webpack-stats.json',
    },
}
integreat_cms.core.settings.WEBSITE_URL: Final[str] = 'https://integreat-app.de'[source]

URL to the Integreat Website

integreat_cms.core.settings.WIKI_URL: Final[str] = 'https://wiki.integreat-app.de'[source]

URL to the Integreat wiki

integreat_cms.core.settings.WSGI_APPLICATION: Final[str] = 'integreat_cms.core.wsgi.application'[source]

WSGI (Web Server Gateway Interface) config (see WSGI_APPLICATION)

integreat_cms.core.settings.XLIFF_DEFAULT_FIELDS: Final[tuple[str, ...]] = ('title', 'content')[source]

The default fields to be used for the XLIFF serialization

('title', 'content')
integreat_cms.core.settings.XLIFF_DOWNLOAD_DIR: Final[str] = '/home/circleci/project/integreat_cms/xliff/download'[source]

The directory from which xliff files can be downloaded (this should be publicly available under the url specified in XLIFF_URL)

integreat_cms.core.settings.XLIFF_EXPORT_VERSION: Final[str] = 'xliff-1.2'[source]

The xliff version to be used for exports

integreat_cms.core.settings.XLIFF_LEGACY_FIELDS: Final[dict[str, str]] = {'body': 'content'}[source]

A mapping for changed field names to preserve backward compatibility after a database field was renamed

{'body': 'content'}
integreat_cms.core.settings.XLIFF_ROOT: Final[str] = '/home/circleci/project/integreat_cms/xliff'[source]

The directory where xliff files are stored

integreat_cms.core.settings.XLIFF_UPLOAD_DIR: Final[str] = '/home/circleci/project/integreat_cms/xliff/upload'[source]

The directory to which xliff files should be uploaded (this should not be reachable by the webserver)

integreat_cms.core.settings.XLIFF_URL: Final[str] = '/xliff/'[source]

The URL path where XLIFF files are served for download

Sphinx Settings

Django settings for the Sphinx documentation builder. All configuration is imported from settings except it sets USE_I18N to False to make sure the documentation is not partially translated.

For more information on this file, see Django settings. For the full list of settings and their values, see Settings.

integreat_cms.core.sphinx_settings.SECRET_KEY = 'dummy'[source]

Set a dummy secret key for documentation build even if it’s not in debug mode

integreat_cms.core.sphinx_settings.USE_I18N = False[source]

A boolean that specifies whether Django’s translation system should be enabled (see USE_I18N and Internationalization and localization)

Storages

This module contains custom Django storages

class integreat_cms.core.storages.MessageLoggerStorage(*args, **kwargs)[source]

Bases: FallbackStorage

Custom messages storage to add debug logging for all messages

Set the MESSAGE_STORAGE setting to the module path of this class to enable logging.

__init__(*args, **kwargs)[source]
add(level: int, message: str | Promise, extra_tags: str = '') None[source]

Add a mew message

Parameters:
Return type:

None

property level[source]

Return the minimum recorded level.

The default level is the MESSAGE_LEVEL setting. If this is not found, the INFO level is used.

storage_classes = (<class 'django.contrib.messages.storage.cookie.CookieStorage'>, <class 'django.contrib.messages.storage.session.SessionStorage'>)[source]
update(response)[source]

Store all unread messages.

If the backend has yet to be iterated, store previously stored messages again. Otherwise, only store messages added after the last iteration.

Urls

Django URL dispatcher. Delegates the following namespaces:

Additionally, the error handlers in error_handler are referenced here (see django.urls functions for use in URLconfs).

For more information on this file, see URL dispatcher.

integreat_cms.core.urls.urlpatterns: list[URLPattern] = [<URLResolver <module 'integreat_cms.api.urls' from '/home/circleci/project/integreat_cms/api/urls.py'> (api:api) ''>, <URLResolver <module 'django.conf.urls.i18n' from '/home/circleci/project/.venv/lib/python3.11/site-packages/django/conf/urls/i18n.py'> (i18n:i18n) 'i18n/'>, <URLResolver <module 'integreat_cms.sitemap.urls' from '/home/circleci/project/integreat_cms/sitemap/urls.py'> (sitemap:sitemap) ''>, <URLResolver <module 'integreat_cms.cms.urls' from '/home/circleci/project/integreat_cms/cms/urls/__init__.py'> (None:None) ''>, <URLResolver [] (media_files:media_files) ''>, <URLResolver [] (pdf_files:pdf_files) ''>, <URLResolver [] (xliff_files:xliff_files) ''>][source]

The url patterns of this module (see URL dispatcher)

[
    <URLResolver <module 'integreat_cms.api.urls' from '/home/circleci/project/integreat_cms/api/urls.py'> (api:api) ''>,
    <URLResolver <module 'django.conf.urls.i18n' from '/home/circleci/project/.venv/lib/python3.11/site-packages/django/conf/urls/i18n.py'> (i18n:i18n) 'i18n/'>,
    <URLResolver <module 'integreat_cms.sitemap.urls' from '/home/circleci/project/integreat_cms/sitemap/urls.py'> (sitemap:sitemap) ''>,
    <URLResolver <module 'integreat_cms.cms.urls' from '/home/circleci/project/integreat_cms/cms/urls/__init__.py'> (None:None) ''>,
    <URLResolver [] (media_files:media_files) ''>,
    <URLResolver [] (pdf_files:pdf_files) ''>,
    <URLResolver [] (xliff_files:xliff_files) ''>,
]

Wsgi

WSGI config for backend project. It exposes the WSGI callable as a module-level variable named application.

WSGI (Web Server Gateway Interface) is a simple calling convention for web servers to forward requests to python frameworks (in our case Django).

For more information on this file, see How to deploy with WSGI.

integreat_cms.core.wsgi.application(environ: dict[str, str], start_response: Callable) WSGIHandler[source]

This returns the WSGI callable

Parameters:
  • environ (dict[str, str]) – The environment variables

  • start_response (Callable) – A function which starts the response

Returns:

The WSGI callable

Return type:

WSGIHandler