-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How to fix "Absolute template path names are deprecated."? #1429
Comments
try this and let me know?
|
This does not seem to work reliably and still raises the deprecation warning. It seems like Line 3383 in 40aec5d
Lines 3283 to 3285 in 40aec5d
|
Oh, that makes sense. So jinja2 is turing it into an absolute path name and then bottle is complaining. |
The deprecation warning should only appear if you are including or extending other templates from within jinja2 using absolute paths. In short, In case of an absolute path, the code in |
I just did a quick test and it seems like I do not receive this warning any more with the development code. My |
I am currently getting the following warning:
This seems to be related to the fact that I explicitly set the
TEMPLATE_PATH
to ensure the template files are found when using a package structure (my template is inmy_package/views/testing.jinja2
):The above code is referenced from the
my_package/__main__.py
file. Runningpython -m my_package
from the parent directory of the package yields the above warning.Without adding the new template path, browsing to the page yields error code 500 with
What is the correct way to resolve the templates when using a "real" package structure?
The text was updated successfully, but these errors were encountered: