-
-
Notifications
You must be signed in to change notification settings - Fork 954
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
When using a custom Jinja loader, directory parameter is unnecessary but still required. #2134
Comments
see this #1214 for the background as to why the API is what is I agree with @alex-oleshkevich that currently the special case for loader is unsatisfactory if you want fine-grained control. |
I think this could also be confusing if people expect the directory to be merged with the loader or something like this. It's not clear what's happening at the moment. But seems like that thread has covered that confusion somewhat. |
@alex-oleshkevich wdyt? |
My opinion: we need only two mutually exclusive parameters for this purpose: I disagree with having
cc @Kludex |
I agree that the environment should be exposed since you can then do whatever you'd like and starlette doesnt have to concern itself with duplicating interfaces. I've also ran into issues where a third party Jinja project assumed I had access to the environment, which we dont with starlette. |
I made a PR to demonstrate the changes we discussed - #2159 |
I've suggested to first deprecate it: #2159 (comment) Then on v1 we can remove it. |
) (#2159) Co-authored-by: Marcelo Trylesinski <[email protected]>
The solution is merged. We can close this issue. |
Thank you for your work on this much appreciated |
In our project we're using Jinja templates like so:
At the moment we use a generic "null" which is not used since in the code if you provide your own loader the default file system loader is bypassed.
starlette/starlette/templating.py
Lines 85 to 86 in 882ab69
With this in mind, if a loader is passed should the directory parameter be entirely optional?
Should the API allow this?
The text was updated successfully, but these errors were encountered: