swh.deposit.config module#

swh.deposit.config.setup_django_for(platform: str | None = None, config_file: str | None = None)[source]#

Setup function for command line tools (e.g. swh.deposit.create_user) to initialize the needed db access.

Note

Do not import any django related module prior to this function call. Otherwise, this will raise a django.core.exceptions.ImproperlyConfigured error message.

Parameters:
  • platform – the platform to use when running program (e.g. cli, …)

  • config_file – Extra configuration file (typically for the production platform)

Raises:

ValueError in case of wrong platform inputs

class swh.deposit.config.APIConfig[source]#

Bases: object

API Configuration centralized class. This loads explicitly the configuration file out of the SWH_CONFIG_FILENAME environment variable.

swh_deposit_authority()[source]#
swh_deposit_fetcher()[source]#