This release modifies how much magic pyramid_jinja2 attempts to do under the hood. As such, there are a some incompatibilities that have been introduced that require manual fixes.
jinja2.directories must be an absolute path or an asset specification. Previously it was possible to use a relative path which pyramid_jinja2 would attempt to handle, but in a very fragile way, requiring that you do config.include('pyramid_jinja2') from the top-level of your project. This quirk was non-obvious, undocumented, and now removed.
Error:
ConfigurationError: A relative path in the "jinja2.directories" setting
is no longer supported as of pyramid_jinja2 3.0. The directory
"templates" must either be an asset specification or an absolute path.
Problem:
jinja2.directories = templates
Fix:
jinja2.directories = myapp:templates
Claim Python 3.4 support [mmerickel]
#75: Fix the missing piece of relative template loading by allowing a template to inherit from a template relative to itself, instead of forcing the parent to be on the search path. [mmerickel]
#73: Added a new config.add_jinja2_renderer API that can create and override multiple Jinja2 renderers, each loaded using potentially different settings and extensions.
The other APIs are now keyed on the renderer extension, as each extension may have different settings. Thus config.add_jinja2_search_path, config.add_jinja2_extension, and config.get_jinja2_environment accept a name argument, which defaults to .jinja2.
This deprecates the old pyramid_jinja2.renderer_factory mechanism for adding renderers with alternate extensions.
Configuration of the renderers has been updated to follow Pyramid’s standard mechanisms for conflict detection. This means that if two modules both try to add a renderer for the .jinja2 extension, they may raise a conflict or the modifications made by the invocation closest to the Configurator in the call-stack will win. This behavior can be affected by calling config.commit at appropriate times to force a configuration to take effect immediately. As such, configuration is deferred until commit-time, meaning that it is now possible config.get_jinja2_environment will return None because the changes have not yet been committed. [mmerickel]
Add pyramid.reload_templates to set jinja2.auto_reload instead of using reload_templates. Deprecate the latter. [Domen Kožar]
Clear bytecode cache on atexit [Domen Kožar]
Add support for more Jinja2 options. Note support for jinja2.autoescape is limited to boolean only.
[Michael Ryabushkin]