diff -pruN 2.4.1-1/debian/changelog 2.4.1-2/debian/changelog
--- 2.4.1-1/debian/changelog	2022-04-05 12:58:11.000000000 +0000
+++ 2.4.1-2/debian/changelog	2022-07-31 20:50:25.000000000 +0000
@@ -1,3 +1,11 @@
+python-django-waffle (2.4.1-2) unstable; urgency=medium
+
+  * Add patch for Django 4 compatibility (Closes: #1013476).
+  * Refresh patches.
+  * Bump Standards-Version to 4.6.1.0.
+
+ -- Michael Fladischer <fladi@debian.org>  Sun, 31 Jul 2022 20:50:25 +0000
+
 python-django-waffle (2.4.1-1) unstable; urgency=low
 
   * New upstream release.
diff -pruN 2.4.1-1/debian/control 2.4.1-2/debian/control
--- 2.4.1-1/debian/control	2022-04-05 12:58:11.000000000 +0000
+++ 2.4.1-2/debian/control	2022-07-31 20:50:25.000000000 +0000
@@ -13,7 +13,7 @@ Build-Depends:
  python3-mock,
  python3-setuptools,
  python3-sphinx,
-Standards-Version: 4.6.0.1
+Standards-Version: 4.6.1.0
 Homepage: https://github.com/django-waffle/django-waffle/
 Vcs-Browser: https://salsa.debian.org/python-team/packages/python-django-waffle
 Vcs-Git: https://salsa.debian.org/python-team/packages/python-django-waffle.git
diff -pruN 2.4.1-1/debian/patches/0001-Exclude-test_app-migrations-package-from-installatio.patch 2.4.1-2/debian/patches/0001-Exclude-test_app-migrations-package-from-installatio.patch
--- 2.4.1-1/debian/patches/0001-Exclude-test_app-migrations-package-from-installatio.patch	2022-04-05 12:58:11.000000000 +0000
+++ 2.4.1-2/debian/patches/0001-Exclude-test_app-migrations-package-from-installatio.patch	2022-07-31 20:50:25.000000000 +0000
@@ -7,7 +7,7 @@ Subject: Exclude test_app migrations pac
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/setup.py b/setup.py
-index ca26e3a..bf2d931 100644
+index 856fc9e..d732e41 100644
 --- a/setup.py
 +++ b/setup.py
 @@ -9,7 +9,7 @@ setup(
diff -pruN 2.4.1-1/debian/patches/0002-Disable-sphinx.ext.mathjax-to-prevent-privacy-breach.patch 2.4.1-2/debian/patches/0002-Disable-sphinx.ext.mathjax-to-prevent-privacy-breach.patch
--- 2.4.1-1/debian/patches/0002-Disable-sphinx.ext.mathjax-to-prevent-privacy-breach.patch	2022-04-05 12:58:11.000000000 +0000
+++ 2.4.1-2/debian/patches/0002-Disable-sphinx.ext.mathjax-to-prevent-privacy-breach.patch	2022-07-31 20:50:25.000000000 +0000
@@ -7,7 +7,7 @@ Subject: Disable sphinx.ext.mathjax to p
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/docs/conf.py b/docs/conf.py
-index e090cf3..0b24af1 100644
+index 394a9b6..867b968 100644
 --- a/docs/conf.py
 +++ b/docs/conf.py
 @@ -25,7 +25,7 @@ import sys, os
diff -pruN 2.4.1-1/debian/patches/0003-Set-mathjax-path-to-local-copy.patch 2.4.1-2/debian/patches/0003-Set-mathjax-path-to-local-copy.patch
--- 2.4.1-1/debian/patches/0003-Set-mathjax-path-to-local-copy.patch	2022-04-05 12:58:11.000000000 +0000
+++ 2.4.1-2/debian/patches/0003-Set-mathjax-path-to-local-copy.patch	2022-07-31 20:50:25.000000000 +0000
@@ -7,7 +7,7 @@ Subject: Set mathjax path to local copy.
  1 file changed, 2 insertions(+)
 
 diff --git a/docs/conf.py b/docs/conf.py
-index 0b24af1..c80a55e 100644
+index 867b968..276c4ab 100644
 --- a/docs/conf.py
 +++ b/docs/conf.py
 @@ -240,3 +240,5 @@ texinfo_documents = [
diff -pruN 2.4.1-1/debian/patches/0004-Django-4-compatibility.patch 2.4.1-2/debian/patches/0004-Django-4-compatibility.patch
--- 2.4.1-1/debian/patches/0004-Django-4-compatibility.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.4.1-2/debian/patches/0004-Django-4-compatibility.patch	2022-07-31 20:50:25.000000000 +0000
@@ -0,0 +1,106 @@
+From: Michael Fladischer <FladischerMichael@fladi.at>
+Date: Sun, 31 Jul 2022 17:55:22 +0000
+Subject: Django 4 compatibility.
+
+---
+ test_app/models.py              | 2 +-
+ test_app/urls.py                | 2 +-
+ waffle/tests/test_middleware.py | 6 +++---
+ waffle/tests/test_mixin.py      | 2 +-
+ waffle/tests/test_templates.py  | 2 +-
+ waffle/tests/test_waffle.py     | 2 +-
+ 6 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/test_app/models.py b/test_app/models.py
+index 423433d..be3d899 100644
+--- a/test_app/models.py
++++ b/test_app/models.py
+@@ -1,7 +1,7 @@
+ from django.contrib.auth.base_user import AbstractBaseUser
+ from django.db import models
+ from django.db.models import CASCADE
+-from django.utils.translation import ugettext_lazy as _
++from django.utils.translation import gettext_lazy as _
+ 
+ from waffle.models import AbstractUserFlag, CACHE_EMPTY
+ from waffle.utils import get_setting, keyfmt, get_cache
+diff --git a/test_app/urls.py b/test_app/urls.py
+index 5fe5e65..0bcad45 100644
+--- a/test_app/urls.py
++++ b/test_app/urls.py
+@@ -1,4 +1,4 @@
+-from django.conf.urls import url, include
++from django.urls import re_path as url, include
+ from django.contrib import admin
+ from django.http import HttpResponseNotFound, HttpResponseServerError
+ 
+diff --git a/waffle/tests/test_middleware.py b/waffle/tests/test_middleware.py
+index a37cbc0..9cc9ff0 100644
+--- a/waffle/tests/test_middleware.py
++++ b/waffle/tests/test_middleware.py
+@@ -13,7 +13,7 @@ def test_set_cookies():
+     assert 'dwf_foo' not in resp.cookies
+     assert 'dwf_bar' not in resp.cookies
+ 
+-    resp = WaffleMiddleware().process_response(get, resp)
++    resp = WaffleMiddleware("").process_response(get, resp)
+     assert 'dwf_foo' in resp.cookies
+     assert 'dwf_bar' in resp.cookies
+ 
+@@ -27,7 +27,7 @@ def test_rollout_cookies():
+                    'baz': [True, False],
+                    'qux': [False, False]}
+     resp = HttpResponse()
+-    resp = WaffleMiddleware().process_response(get, resp)
++    resp = WaffleMiddleware("").process_response(get, resp)
+     for k in get.waffles:
+         cookie = 'dwf_%s' % k
+         assert cookie in resp.cookies
+@@ -42,7 +42,7 @@ def test_testing_cookies():
+     get.waffles = {}
+     get.waffle_tests = {'foo': True, 'bar': False}
+     resp = HttpResponse()
+-    resp = WaffleMiddleware().process_response(get, resp)
++    resp = WaffleMiddleware("").process_response(get, resp)
+     for k in get.waffle_tests:
+         cookie = 'dwft_%s' % k
+         assert str(get.waffle_tests[k]) == resp.cookies[cookie].value
+diff --git a/waffle/tests/test_mixin.py b/waffle/tests/test_mixin.py
+index 35ba1aa..7d08dbd 100644
+--- a/waffle/tests/test_mixin.py
++++ b/waffle/tests/test_mixin.py
+@@ -16,7 +16,7 @@ def get(**kw):
+ 
+ def process_request(request, view):
+     response = view.as_view()(request)
+-    return WaffleMiddleware().process_response(request, response)
++    return WaffleMiddleware("").process_response(request, response)
+ 
+ 
+ class WaffleFlagMixinTest(TestCase):
+diff --git a/waffle/tests/test_templates.py b/waffle/tests/test_templates.py
+index fb91d5b..780b684 100644
+--- a/waffle/tests/test_templates.py
++++ b/waffle/tests/test_templates.py
+@@ -19,7 +19,7 @@ def get():
+ 
+ def process_request(request, view):
+     response = view(request)
+-    return WaffleMiddleware().process_response(request, response)
++    return WaffleMiddleware("").process_response(request, response)
+ 
+ 
+ class WaffleTemplateTests(TestCase):
+diff --git a/waffle/tests/test_waffle.py b/waffle/tests/test_waffle.py
+index 1b906ee..75d62e6 100644
+--- a/waffle/tests/test_waffle.py
++++ b/waffle/tests/test_waffle.py
+@@ -32,7 +32,7 @@ def get(**kw):
+ 
+ def process_request(request, view):
+     response = view(request)
+-    return WaffleMiddleware().process_response(request, response)
++    return WaffleMiddleware("").process_response(request, response)
+ 
+ 
+ class WaffleTests(TestCase):
diff -pruN 2.4.1-1/debian/patches/series 2.4.1-2/debian/patches/series
--- 2.4.1-1/debian/patches/series	2022-04-05 12:58:11.000000000 +0000
+++ 2.4.1-2/debian/patches/series	2022-07-31 20:50:25.000000000 +0000
@@ -1,3 +1,4 @@
 0001-Exclude-test_app-migrations-package-from-installatio.patch
 0002-Disable-sphinx.ext.mathjax-to-prevent-privacy-breach.patch
 0003-Set-mathjax-path-to-local-copy.patch
+0004-Django-4-compatibility.patch
