From d310c33d840748d27b76f0108fc8deb73b7f59ef Mon Sep 17 00:00:00 2001 From: Ronan Boiteau Date: Thu, 18 Apr 2024 01:23:05 +0300 Subject: [PATCH 1/2] Add official support for Django 4.2 and drop deprecated Django 3.2 --- CHANGELOG.md | 7 ++ README.md | 152 ++++++++++++++++++++--------------------- pyproject.toml | 2 +- tests/requirements.txt | 2 +- 4 files changed, 85 insertions(+), 78 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b9f3b..71e5519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Unreleased + +- Add official support for Django 4.2: + - Use Django 4.2 in technical tests + - Review all the Django 4.2 built-in template tags and filters (no changes needed) +- Drop official support for Django 3.2 (still unofficially supported in this version as there are no breaking changes) + ## 1.2.0 - 2024-04-18 - Add official support for Python 3.12 diff --git a/README.md b/README.md index e55cc76..1dff016 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Django template engine to render untrusted template code ## Requirements - Python 3.8 to 3.12 -- Django 3.2 (officially supported in automated tests, all built-in template tags and filters reviewed) +- Django 4.2 (officially supported in automated tests, all built-in template tags and filters reviewed) ## Available tools @@ -50,85 +50,85 @@ The following tags and filters are allowed by this template engine. ### Trusted tags -- [`autoescape`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#autoescape) -- [`comment`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#comment) -- [`cycle`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#cycle) -- [`filter`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#filter) -- [`firstof`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#firstof) -- [`for`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#for) -- [`for … empty`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#for-empty) -- [`if`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#if) -- [`ifchanged`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#ifchanged) -- [`lorem`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#lorem) -- [`now`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#now) -- [`regroup`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#regroup) -- [`resetcycle`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#resetcycle) -- [`spaceless`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#spaceless) -- [`templatetag`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#templatetag) -- [`url`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#url) -- [`verbatim`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#verbatim) -- [`widthratio`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#widthratio) -- [`with`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#with) +- [`autoescape`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#autoescape) +- [`comment`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#comment) +- [`cycle`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#cycle) +- [`filter`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#filter) +- [`firstof`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#firstof) +- [`for`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#for) +- [`for … empty`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#for-empty) +- [`if`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#if) +- [`ifchanged`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#ifchanged) +- [`lorem`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#lorem) +- [`now`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#now) +- [`regroup`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#regroup) +- [`resetcycle`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#resetcycle) +- [`spaceless`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#spaceless) +- [`templatetag`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#templatetag) +- [`url`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#url) +- [`verbatim`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#verbatim) +- [`widthratio`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#widthratio) +- [`with`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#with) ### Trusted filters -- [`add`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#add) -- [`addslashes`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#addslashes) -- [`capfirst`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#capfirst) -- [`center`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#center) -- [`cut`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#cut) -- [`date`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#date) -- [`default_if_none`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#default_if_none) -- [`default`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#default) -- [`dictsort`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#dictsort) -- [`dictsortreversed`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#dictsortreversed) -- [`divisibleby`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#divisibleby) -- [`escape`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#escape) -- [`escapejs`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#escapejs) -- [`filesizeformat`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#filesizeformat) -- [`first`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#first) -- [`floatformat`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#floatformat) -- [`force_escape`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#force_escape) -- [`get_digit`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#get_digit) -- [`iriencode`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#iriencode) -- [`join`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#join) -- [`json_script`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#json_script) -- [`last`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#last) -- [`length_is`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#length_is) -- [`length`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#length) -- [`linebreaks`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#linebreaks) -- [`linebreaksbr`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#linebreaksbr) -- [`linenumbers`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#linenumbers) -- [`ljust`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#ljust) -- [`lower`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#lower) -- [`make_list`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#make_list) -- [`phone2numeric`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#phone2numeric) -- [`pluralize`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#pluralize) -- [`random`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#random) -- [`rjust`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#rjust) -- [`safe`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#safe) -- [`safeseq`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#safeseq) -- [`slice`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#slice) -- [`slugify`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#slugify) -- [`stringformat`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#stringformat) -- [`striptags`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#striptags) -- [`time`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#time) -- [`timesince`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#timesince) -- [`timeuntil`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#timeuntil) -- [`title`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#title) -- [`truncatechars_html`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#truncatechars_html) -- [`truncatechars`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#truncatechars) -- [`truncatewords_html`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#truncatewords_html) -- [`truncatewords`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#truncatewords) -- [`unordered_list`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#unordered_list) -- [`upper`](https://docs.djangopr§oject.com/en/3.2/ref/templates/builtins/#upper) -- [`urlencode`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#urlencode) -- [`urlize`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#urlize) -- [`urlizetrunc`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#urlizetrunc) -- [`wordcount`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#wordcount) -- [`wordwrap`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#wordwrap) -- [`yesno`](https://docs.djangoproject.com/en/3.2/ref/templates/builtins/#yesno) +- [`add`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#add) +- [`addslashes`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#addslashes) +- [`capfirst`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#capfirst) +- [`center`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#center) +- [`cut`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#cut) +- [`date`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#date) +- [`default_if_none`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#default_if_none) +- [`default`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#default) +- [`dictsort`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#dictsort) +- [`dictsortreversed`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#dictsortreversed) +- [`divisibleby`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#divisibleby) +- [`escape`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#escape) +- [`escapejs`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#escapejs) +- [`filesizeformat`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#filesizeformat) +- [`first`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#first) +- [`floatformat`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#floatformat) +- [`force_escape`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#force_escape) +- [`get_digit`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#get_digit) +- [`iriencode`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#iriencode) +- [`join`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#join) +- [`json_script`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#json_script) +- [`last`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#last) +- [`length_is`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#length_is) +- [`length`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#length) +- [`linebreaks`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#linebreaks) +- [`linebreaksbr`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#linebreaksbr) +- [`linenumbers`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#linenumbers) +- [`ljust`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#ljust) +- [`lower`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#lower) +- [`make_list`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#make_list) +- [`phone2numeric`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#phone2numeric) +- [`pluralize`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#pluralize) +- [`random`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#random) +- [`rjust`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#rjust) +- [`safe`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#safe) +- [`safeseq`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#safeseq) +- [`slice`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#slice) +- [`slugify`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#slugify) +- [`stringformat`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#stringformat) +- [`striptags`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#striptags) +- [`time`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#time) +- [`timesince`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#timesince) +- [`timeuntil`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#timeuntil) +- [`title`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#title) +- [`truncatechars_html`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#truncatechars_html) +- [`truncatechars`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#truncatechars) +- [`truncatewords_html`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#truncatewords_html) +- [`truncatewords`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#truncatewords) +- [`unordered_list`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#unordered_list) +- [`upper`](https://docs.djangopr§oject.com/en/4.2/ref/templates/builtins/#upper) +- [`urlencode`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#urlencode) +- [`urlize`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#urlize) +- [`urlizetrunc`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#urlizetrunc) +- [`wordcount`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#wordcount) +- [`wordwrap`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#wordwrap) +- [`yesno`](https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#yesno) ## Contribute diff --git a/pyproject.toml b/pyproject.toml index 4f5b204..357edcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "django_safe_template_engine" version = "1.2.0" -dependencies = ["django >= 3.2, < 4"] +dependencies = ["django >= 4.2, < 5"] requires-python = ">=3.8" authors = [{ name = "Ronan Boiteau", email = "ronan@boiteau.eu" }] maintainers = [{ name = "Ronan Boiteau", email = "ronan@boiteau.eu" }] diff --git a/tests/requirements.txt b/tests/requirements.txt index 21356e5..72df235 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -9,4 +9,4 @@ mypy # Test tools: pytest -django == 3.2.* +django == 4.2.* From 361c9179410cea43f11b5d1dd49aedef54ab8aa6 Mon Sep 17 00:00:00 2001 From: Ronan Boiteau Date: Thu, 18 Apr 2024 02:21:27 +0300 Subject: [PATCH 2/2] Improve changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7992193..c97e087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Unreleased - Add official support for Django 4.2: - - Use Django 4.2 in technical tests + - Use Django 4.2 in automated tests - Review all the Django 4.2 built-in template tags and filters (no changes needed) - Use [tox](https://tox.wiki/) to manage test suite environment @@ -20,7 +20,7 @@ ## 1.1.0 - 2024-02-04 - Add official support for Django 3.2: - - Use Django 3.2 in technical tests + - Use Django 3.2 in automated tests - Review all the Django 3.2 built-in template tags and filters (no changes needed) - Drop official support for Django 3.0 (still unofficially supported in this version as there are no breaking changes) - Remove Python 3.7 from supported versions in `pyproject.toml` (never officially supported) @@ -31,5 +31,5 @@ - Review all the Django 3.0 built-in template tags and filters: - Allow the ones considered safe - Make sure the rest is forbidden with technical test coverage -- Add official support for Python 3.8 to Python 3.11 (covered by technical tests) -- Add official support for Django 3.0 (covered by technical tests) +- Add official support for Python 3.8 to Python 3.11 (covered by automated tests) +- Add official support for Django 3.0 (covered by automated tests)