Skip to content

Commit

Permalink
Merge branch 'release/5.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Jul 23, 2023
2 parents 68c1a79 + cd592cb commit 93c4ffe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pydantic import BaseSettings

{%- else %}
from pydantic_settings import BaseSettings
from pydantic_settings import BaseSettings, SettingsConfigDict

{%- endif %}

Expand Down Expand Up @@ -200,10 +200,20 @@ def rabbit_url(self) -> URL:
)
{%- endif %}

{%- if cookiecutter.pydanticv1 == "True" %}
class Config:
env_file = ".env"
env_prefix = "{{cookiecutter.project_name | upper }}_"
env_file_encoding = "utf-8"

{%- else %}
model_config = SettingsConfigDict(
env_file = ".env",
env_prefix = "{{cookiecutter.project_name | upper }}_",
env_file_encoding = "utf-8",
)
{%- endif %}



settings = Settings()

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fastapi_template"
version = "5.0.1"
version = "5.0.2"
description = "Feature-rich robust FastAPI template"
authors = ["Pavel Kirilin <[email protected]>"]
packages = [{ include = "fastapi_template" }]
Expand Down

0 comments on commit 93c4ffe

Please sign in to comment.