Settings

class app.settings.Settings(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, environment: str = 'development', log_level: int | str = 20, database_url: str = 'postgresql:///credere_backend?application_name=credere_backend', test_database_url: str = '', hash_key: str = '', max_file_size_mb: int = 20, application_expiration_days: int = 7, reminder_days_before_expiration: int = 3, reminder_days_before_lapsed: int = 3, reminder_days_before_lapsed_for_external_onboarding: int = 13, progress_to_remind_started_applications: float = 0.7, days_to_change_to_lapsed: int = 14, days_to_erase_borrowers_data: int = 7, colombia_secop_app_token: str = '', secop_pagination_limit: int = 5, secop_default_days_from_ultima_actualizacion: int = 365, email_sender_address: str = 'credere@noreply.open-contracting.org', ocp_email_group: str = 'credere@noreply.open-contracting.org', test_mail_receiver: str = 'credere@noreply.open-contracting.org', frontend_url: str = 'http://localhost:3000', backend_url: str = 'http://localhost:8000', email_template_lang: str = 'es', images_base_url: str = 'https://credere.open-contracting.org/images', aws_region: str = 'us-west-2', aws_access_key: str = '', aws_client_secret: str = '', cognito_pool_id: str = '', cognito_client_id: str = '', cognito_client_secret: str = '', sentry_dsn: str = '')[source]

Each setting has a corresponding uppercase environment variable.

environment: str

If “production”, emails all recipients. Otherwise, emails lenders and ocp_email_group only, replacing borrower email addresses with test_mail_receiver.

log_level: int | str

The logging level of the root logger.

database_url: str

PostgreSQL connection string.

test_database_url: str

PostgreSQL connection string that overrides DATABASE_URL (tests drops the database).

hash_key: str

The secret key with which to hash borrower identifiers (to allow for deduplication even after the borrower’s information has been removed).

max_file_size_mb: int

The maximum file size of uploaded documents or uploaded contracts (sync with VITE_MAX_FILE_SIZE_MB in Credere frontend).

application_expiration_days: int

The number of days after the application is created, after which a PENDING or DECLINED application becomes inaccessible to the borrower.

reminder_days_before_expiration: int

The number of days before a PENDING application’s expiration date, past which the borrower is sent a reminder.

reminder_days_before_lapsed: int

The number of days before an ACCEPTED application’s lapsed date, past which the borrower is sent a reminder.

reminder_days_before_lapsed_for_external_onboarding: int
progress_to_remind_started_applications: float

Lenders agree to respond to application changes (STARTED, CONTRACT_UPLOADED) within a number of days, known as Service Level Agreement (SLA) days (app.models.Lender.sla_days).

This is the ratio of SLA days for which to wait for the lender to respond, after which an application is overdue, and the lender is sent a reminder.

For example, if set to 0.7, a lender with 10 SLA days receives the first reminder after an application has been waiting for the lender to respond for 7 days.

days_to_change_to_lapsed: int

The number of days for which to wait for the borrower to respond, after which an application becomes LAPSED.

days_to_erase_borrowers_data: int

The number of days after the application reaches a final state, after which the application is archived.

colombia_secop_app_token: str

The application token to the SECOP API.

secop_pagination_limit: int

The number of items to retrieve at once in python -m app fetch-awards.

secop_default_days_from_ultima_actualizacion: int

The number of days of past items to retrieve the first time python -m app fetch-awards runs.

email_sender_address: str

The verified email address in Amazon SES to use as the FROM email address.

ocp_email_group: str

The email address of Credere administrators, to notify about new and overdue applications.

test_mail_receiver: str

The email address with which to replace borrower email addresses in a non-production environment (for example, your own email address).

frontend_url: str

The base URL of Credere.

email_template_lang: str

The language of the email templates to use.

images_base_url: str

The base URL of Credere’s images directory (can be a CDN URL).

aws_region: str

Amazon Web Services region.

aws_access_key: str

Operational user access key.

aws_client_secret: str

Operational user client secret.

cognito_pool_id: str

Cognito user pool ID.

cognito_client_id: str

Cognito app client ID.

cognito_client_secret: str

Cognito app client secret.

sentry_dsn: str

Sentry DSN.