Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ Modify or add SQLModel models for data and SQL tables in `./backend/app/models.p

Add and modify tasks to the Celery worker in `./backend/app/worker.py`.

### VS Code

There are already configurations in place to run the backend through the VS Code debugger, so that you can use breakpoints, pause and explore variables, etc.

The setup is also already configured so you can run the tests through the VS Code Python tests tab.

### Docker Compose Override

During development, you can change Docker Compose settings that will only affect the local development environment in the file `docker-compose.override.yml`.
Expand Down
5 changes: 3 additions & 2 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def parse_cors(v: Any) -> list[str] | str:


class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_ignore_empty=True)
model_config = SettingsConfigDict(
env_file=".env", env_ignore_empty=True, extra="ignore"
)
API_V1_STR: str = "/api/v1"
SECRET_KEY: str = secrets.token_urlsafe(32)
# 60 minutes * 24 hours * 8 days = 8 days
Expand Down Expand Up @@ -77,7 +79,6 @@ def set_default_emails_from(self) -> Self:
return self

EMAIL_RESET_TOKEN_EXPIRE_HOURS: int = 48
EMAIL_TEMPLATES_DIR: str = "/app/app/email-templates/build"

@computed_field # type: ignore[misc]
@property
Expand Down
4 changes: 3 additions & 1 deletion backend/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class EmailData:


def render_email_template(*, template_name: str, context: dict[str, Any]) -> str:
template_str = (Path(settings.EMAIL_TEMPLATES_DIR) / template_name).read_text()
template_str = (
Path(__file__).parent / "email-templates" / "build" / template_name
).read_text()
html_content = Template(template_str).render(context)
return html_content

Expand Down