You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe your use case.
The jinja2 render() function accepts a template_name or template_source. it's unclear where template_name is searching for because if I plug in an absolute path (on a Windows machine, haven't tested in Linux), it won't coerce it to a string and if I coerce a pathlib.Path to a string directly using str(path), it still won't resolve.
I almost feel like it requires a relative path? Not sure. It's unclear what template_name is pointing at.
Describe the solution you'd like
Clearer or more flexible handling of the template_name argument in render. it should be capable of taking a pathlib.Path or a path-like string just fine.
EDIT
Okay, I actually discovered that my problem was in not setting app.config.TEMPLATING_PATH_TO_TEMPLATES, which wasn't mentioned at all under https://sanic.dev/en/plugins/sanic-ext/templating.htm and probably SHOULD be explained more clearly.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe your use case.
The jinja2 render() function accepts a template_name or template_source. it's unclear where template_name is searching for because if I plug in an absolute path (on a Windows machine, haven't tested in Linux), it won't coerce it to a string and if I coerce a pathlib.Path to a string directly using str(path), it still won't resolve.
I almost feel like it requires a relative path? Not sure. It's unclear what template_name is pointing at.
Describe the solution you'd like
Clearer or more flexible handling of the template_name argument in render. it should be capable of taking a pathlib.Path or a path-like string just fine.
EDIT
Okay, I actually discovered that my problem was in not setting app.config.TEMPLATING_PATH_TO_TEMPLATES, which wasn't mentioned at all under https://sanic.dev/en/plugins/sanic-ext/templating.htm and probably SHOULD be explained more clearly.
The text was updated successfully, but these errors were encountered: