Skip to content

Commit

Permalink
Merge pull request #23 from ronanboiteau/rb-240418-support-django-4.2
Browse files Browse the repository at this point in the history
Add official support for Django 4.2
  • Loading branch information
ronanboiteau authored Apr 17, 2024
2 parents 589dd45 + 361c917 commit ce49f47
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 80 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Add official support for Django 4.2:
- 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

## 1.2.0 - 2024-04-18
Expand All @@ -17,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)
Expand All @@ -28,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)
152 changes: 76 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 3.2 to 4.2 (officially supported in automated tests, all built-in template tags and filters reviewed)

## Available tools

Expand Down Expand Up @@ -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

<!-- TODO: Check for dead links -->
- [`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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "django_safe_template_engine"
version = "1.2.0"
dependencies = ["django >= 3.2, < 4"]
dependencies = ["django >= 3.2, < 5"]
requires-python = ">=3.8"
authors = [{ name = "Ronan Boiteau", email = "ronan@boiteau.eu" }]
maintainers = [{ name = "Ronan Boiteau", email = "ronan@boiteau.eu" }]
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist =
django32,
django42,
lint
isolated_build = true

Expand All @@ -11,6 +12,7 @@ commands =
python run_tests.py
deps =
django32: Django>=3.2,<4
django42: Django>=4.2,<5
pytest
mypy

Expand Down

0 comments on commit ce49f47

Please sign in to comment.