Skip to content

Commit

Permalink
fix: set jinja options for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 17, 2024
1 parent 5e4058b commit b92873e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import os
import secrets
import sys
from datetime import timezone
from pathlib import Path

import tomli
from dotenv import load_dotenv


DEV = sys.platform == "win32"

UTC = timezone.utc

PROJECT_PATH = Path(__file__, "..").resolve()
Expand Down
4 changes: 3 additions & 1 deletion server/tmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
from jinja2.runtime import Context
from litestar import Request

from config import PROJECT_PATH, UTC
from config import DEV, PROJECT_PATH, UTC


engine = jinja2.Environment(
autoescape=True,
loader=jinja2.FileSystemLoader(PROJECT_PATH.joinpath("server", "templates")),
cache_size=int(DEV) * 400,
auto_reload=not DEV,
)


Expand Down

0 comments on commit b92873e

Please sign in to comment.