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 –