Конфигурация
- База данных
- Брокер
- Учетные данные
- Логирование
- Сессия
- Cors
- Отладка
- Мониторинг
- Статические файлы
- Openapi
Bases: BaseSettings
Server application settings.
The settings can be passed in several ways:
- By storing settings in a configuration file
config.yml(preferred). - By setting environment variables matching specific keys (
SYNCMASTER__DATABASE__URL==database.url). - By explicitly passing a settings object as an argument of application factory function.
More details can be found in
Pydantic documentation <https://docs.pydantic.dev/latest/concepts/pydantic_settings/>_.
Examples
.. code-block:: yaml :caption: config.yml
database:
url: postgresql+asyncpg://postgres:postgres@localhost:5432/syncmaster
broker:
url: amqp://user:password@localhost:5672/
logging: {}
encryption: {}
server: {}
auth: {}
Source code in syncmaster/server/settings/__init__.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
Bases: BaseModel
Server server settings.
Examples
.. code-block:: yaml :caption: config.yml
server:
debug: true
request_id:
enabled: true
cors:
enabled: true
monitoring:
enabled: true
openapi:
enabled: true
static_files:
enabled: true
Source code in syncmaster/server/settings/server/__init__.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |