Skip to content

Commit

Permalink
Adding dynaconf to manage the application general settings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcieltorres committed Jun 24, 2023
1 parent 9bf19d1 commit 781c827
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ COPY . .

FROM dependencies AS production
COPY src src
COPY settings.toml src
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A python boilerplate project using poetry
- [Docker Compose](https://docs.docker.com/compose/) - **pre-requisite**
- [Poetry](https://python-poetry.org/) - **pre-requisite**
- [Ruff](https://github.com/astral-sh/ruff)
- [Dynaconf](https://www.dynaconf.com/)

*Please pay attention on **pre-requisites** resources that you must install/configure.*

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "MIT"

[tool.poetry.dependencies]
python = "^3.11"
dynaconf = "3.1.12"

[tool.poetry.dev-dependencies]
pytest = "7.3.2"
Expand Down
9 changes: 9 additions & 0 deletions settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[default]

[development]

[test]

[qa]

[prod]
8 changes: 8 additions & 0 deletions src/config/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from dynaconf import Dynaconf

settings = Dynaconf(
settings_files=["./settings.toml"],
environments=True,
load_dotenv=True,
env_switcher="ENV",
)

0 comments on commit 781c827

Please sign in to comment.