- Prefix loader was not forwarding the locals properly to
inner loaders. This is now fixed.
- Security issue: Changed the default folder for the filesystem cache to be
- user specific and read and write protected on UNIX systems. See `Debian bug
- 734747`_ for more information.
+ user specific and read and write protected on UNIX systems. See
+ `Debian bug 734747`_ for more information.
-.. _Debian bug 734747: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734747
+.. _Debian bug 734747: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734747
Version 2.7.1
-------------
u'f\xf6\xf6'
-.. _Unicode documentation: http://docs.python.org/dev/howto/unicode.html
+.. _Unicode documentation: https://docs.python.org/3/howto/unicode.html
High Level API
--------------
The usage of the `i18n` extension for template designers is covered as part
:ref:`of the template documentation <i18n-in-templates>`.
-.. _gettext: http://docs.python.org/dev/library/gettext
+.. _gettext: https://docs.python.org/3/library/gettext.html
.. _Babel: http://babel.pocoo.org/
.. _newstyle-gettext:
~~~~~~~~~~~~~~~~~
The following example implements a `cache` tag for Jinja2 by using the
-`Werkzeug`_ caching contrib module:
+`cachelib`_ library:
.. literalinclude:: cache_extension.py
:language: python
And here is how you use it in an environment::
from jinja2 import Environment
- from werkzeug.contrib.cache import SimpleCache
+ from cachelib import SimpleCache
env = Environment(extensions=[FragmentCacheExtension])
env.fragment_cache = SimpleCache()
</div>
{% endcache %}
-.. _Werkzeug: http://werkzeug.pocoo.org/
+.. _cachelib: https://github.com/pallets/cachelib
Extension API
~~~~~~~~~~~~~
usual bottleneck in a web application is either the database or the application
code.
-.. _Mako: http://www.makotemplates.org/
+.. _Mako: https://www.makotemplates.org/
How Compatible is Jinja2 with Django?
-------------------------------------
sandbox._WHITE_LIST_C_MODULES += ['_ctypes', 'gestalt']
Credit for this snippet goes to `Thomas Johansson
-<http://stackoverflow.com/questions/3086091/debug-jinja2-in-google-app-engine/3694434#3694434>`_
+<https://stackoverflow.com/questions/3086091/debug-jinja2-in-google-app-engine/3694434#3694434>`_
Why is there no Python 2.3/2.4/2.5/3.1/3.2 support?
---------------------------------------------------
issue rename the macro or variable in the parent template to have an
uncommon prefix.
-.. _Jinja 1: http://jinja.pocoo.org/1/
+.. _Jinja 1: https://pypi.org/project/Jinja/
config['pylons.strict_c'] = True
-.. _Pylons: http://www.pylonshq.com/
+.. _Pylons: https://pylonshq.com/
TextMate
--------
A syntax plugin for `Vim`_ exists in the Vim-scripts directory as well as the
`ext` folder at the root of the Jinja2 project. `The script
-<http://www.vim.org/scripts/script.php?script_id=1856>`_ supports Jinja1 and
+<https://www.vim.org/scripts/script.php?script_id=1856>`_ supports Jinja1 and
Jinja2. Once installed two file types are available `jinja` and `htmljinja`.
The first one for text based templates, the latter for HTML templates.
Copy the files into your `syntax` folder.
.. _Babel: http://babel.pocoo.org/
-.. _Vim: http://www.vim.org/
+.. _Vim: https://www.vim.org/
which will install the package via `distribute` in development mode. This also
has the advantage that the C extensions are compiled.
-.. _download page: http://pypi.python.org/pypi/Jinja2
-.. _distribute: http://pypi.python.org/pypi/distribute
-.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
-.. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall
-.. _pip: http://pypi.python.org/pypi/pip
-.. _git: http://git-scm.org/
+.. _download page: https://pypi.org/project/Jinja2/
+.. _distribute: https://pypi.org/project/distribute/
+.. _setuptools: https://pypi.org/project/setuptools/
+.. _easy_install: https://setuptools.readthedocs.io/en/latest/easy_install.html
+.. _pip: https://pypi.org/project/pip/
+.. _git: https://git-scm.com/
MarkupSafe Dependency
install Jinja2 via `pip` or `easy_install` it will be installed
automatically for you.
-.. _MarkupSafe: http://pypi.python.org/pypi/MarkupSafe
+.. _MarkupSafe: https://markupsafe.palletsprojects.com/
Basic API Usage
---------------
for yourself.
-.. _Jinja bug tracker: http://github.com/pallets/jinja/issues
+.. _Jinja bug tracker: https://github.com/pallets/jinja/issues
Libraries compatible with this class:
- - `werkzeug <http://werkzeug.pocoo.org/>`_.contrib.cache
- - `python-memcached <http://www.tummy.com/Community/software/python-memcached/>`_
- - `cmemcache <http://gijsbert.org/cmemcache/>`_
+ - `cachelib <https://github.com/pallets/cachelib>`_
+ - `python-memcached <https://pypi.org/project/python-memcached/>`_
(Unfortunately the django cache interface is not compatible because it
does not support storing binary data, only unicode. You can however pass