Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] #225

Open
volundmush opened this issue Aug 25, 2023 · 0 comments
Open

[Feature Request] #225

volundmush opened this issue Aug 25, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@volundmush
Copy link

volundmush commented Aug 25, 2023

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.

@ahopkins ahopkins added the documentation Improvements or additions to documentation label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants