Skip to content

Instantly share code, notes, and snippets.

@philmade
Created March 5, 2020 11:17
Show Gist options
  • Save philmade/6a0056fd1f7e8375cad44f926ab24090 to your computer and use it in GitHub Desktop.
Save philmade/6a0056fd1f7e8375cad44f926ab24090 to your computer and use it in GitHub Desktop.
from starlette.templating import Jinja2Templates
from .template_env import timesince, price_format, bot_insert, get_flashed_messages
templates = Jinja2Templates(directory="app/templates")
templates.env.filters.update({"timesince": timesince,
"price_format": price_format})
templates.env.globals.update({"bot_insert": bot_insert,
"get_flashed_messages": get_flashed_messages})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment