Reference

Public API documentation.

Utilities

class open_api_framework.conf.utils.EnvironmentVariable(name: str, default: Any, help_text: str, group: str | None = None, auto_display_default: bool = True)
open_api_framework.conf.utils.config(option: str, default: ~typing.Any = <decouple.Undefined object>, help_text='', group=None, add_to_docs=True, auto_display_default=True, *args, **kwargs)

An override of decouple.config, with custom options to construct documentation for environment variables.

Pull a config parameter from the environment.

Read the config variable option. If it’s optional, use the default value. Input is automatically cast to the correct type, where the type is derived from the default value if possible.

Pass split=True to split the comma-separated input into a list.

Additionally, the variable is added to a registry that is used to construct documentation via the generate_envvar_docs management command. The following arguments are added for this:

Parameters:
  • help_text – The help text to be displayed for this variable in the documentation. Default “”

  • group – The name of the section under which this variable will be grouped. Default None

  • add_to_docs – Whether or not this variable will be displayed in the documentation. Default True

  • auto_display_default – Whether or not the passed default value is displayed in the docs, this can be set to False in case a default needs more explanation that can be added to the help_text (e.g. if it is computed or based on another variable). Default True

open_api_framework.conf.utils.get_sentry_integrations() list

Determine which Sentry SDK integrations to enable.

open_api_framework.conf.utils.mute_logging(config: dict) None

Disable (console) output from logging. :arg config: The logging config, typically the django LOGGING setting.