Add convert_times function to jinja2
(useful, if you want to include times in templates)
This commit is contained in:
parent
b1a56edc57
commit
1663a060d9
1 changed files with 6 additions and 3 deletions
|
@ -8,6 +8,7 @@ import httpx
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
from . import utils
|
||||||
basedir = os.path.dirname(__file__)
|
basedir = os.path.dirname(__file__)
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
|
app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
|
||||||
|
@ -15,7 +16,9 @@ app.mount("/static", StaticFiles(directory=basedir + "/static"), name="static")
|
||||||
template_env = jinja2.Environment(
|
template_env = jinja2.Environment(
|
||||||
loader=jinja2.PackageLoader("iwm_browser", "templates"),
|
loader=jinja2.PackageLoader("iwm_browser", "templates"),
|
||||||
auto_reload=True
|
auto_reload=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
template_env.globals['convert_times'] = utils.convert_times
|
||||||
|
|
||||||
BASE_URL = "http://make.fangam.es"
|
BASE_URL = "http://make.fangam.es"
|
||||||
THUMB_URL = "https://images.make.fangam.es"
|
THUMB_URL = "https://images.make.fangam.es"
|
||||||
|
|
Loading…
Reference in a new issue