This repository was archived by the owner on Jun 19, 2026. It is now read-only.
Fix Django 6.0 pagination error in jazzmin admin template#350
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Co-authored-by: gdsanger <59723667+gdsanger@users.noreply.github.com>
Co-authored-by: gdsanger <59723667+gdsanger@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix template error in jazzmin pagination.html
Fix Django 6.0 pagination error in jazzmin admin template
Dec 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Django 6.0 changed
format_html()to require formatting arguments. The jazzmin package (v3.0.1) callsformat_html(html_str)without arguments, causingTypeError: args or kwargs must be providedon admin list views with pagination.Changes
fix_jazzmin.sh: Automated patch script that replacesformat_html(html_str)withmark_safe(html_str)in jazzmin'sjazzmin_paginator_numbertemplate tag (line 256)JAZZMIN_FIX_README.md: Documentation explaining the patch, deployment instructions, and why template tag override approaches don't workcore/tests_jazzmin_templatetag.py: Unit tests verifying the patched template tag works without errorsImplementation
The patch modifies the installed jazzmin package:
mark_safe()is appropriate here because the HTML is pre-formatted from Django's trusted ChangeList object. The patch must be reapplied after reinstalling/upgrading jazzmin until an official fix is released.Run as part of deployment:
Original prompt
This section details on the original issue you should resolve
<issue_title>/jazzmin/templates/admin/pagination.html, error at line 26</issue_title>
<issue_description>Environment:
Request Method: GET
Request URL: https://fi.angermeier.net/admin/core/booking/
Django Version: 6.0
Python Version: 3.12.12
Installed Applications:
['core',
'jazzmin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'trading']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware']
Template error:
In template /opt/Finoa/.venv/lib/python3.12/site-packages/jazzmin/templates/admin/pagination.html, error at line 26
args or kwargs must be provided.
16 : {% if cl.formset and cl.result_count %}
17 :
18 : {% endif %}
19 :
20 :
21 :
22 :
23 :
24 : {% if pagination_required %}
25 : {% for i in page_range %}
26 : {% jazzmin_paginator_number cl i %}
27 : {% endfor %}
28 : {% endif %}
29 :
30 :
31 :
Traceback (most recent call last):
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 221, in _get_response
response = response.render()
^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/response.py", line 114, in render
self.content = self.rendered_content
^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/response.py", line 92, in rendered_content
return template.render(context, self._request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/backends/django.py", line 107, in render
return self.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 174, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 166, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 1091, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 1052, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 160, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 166, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 1091, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 1052, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/loader_tags.py", line 160, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 166, in _render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 1091, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/Finoa/.venv/lib/python3.12/site-packages/django/template/base.py", line 1052, in render_annotated
return self.render(context)
...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.