[PATCH 05/10] manage: Check Django version on startup

Stephen Finucane stephen at that.guru
Sat Oct 1 02:19:16 AEST 2022


This was recently reported as an issue. Add a simple check to ensure
people update their dependencies as expected.

Signed-off-by: Stephen Finucane <stephen at that.guru>
Cc: Siddhesh Poyarekar <sipoyare at redhat.com>
Cc: DJ Delorie <dj at redhat.com>
Cc: Carlos O'Donell <carlos at redhat.com>
---
 manage.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git manage.py manage.py
index 033c8ae4..e227481e 100755
--- manage.py
+++ manage.py
@@ -7,6 +7,11 @@ if __name__ == "__main__":
         "DJANGO_SETTINGS_MODULE", "patchwork.settings.production"
     )
 
+    import django
+
+    if django.VERSION < (3, 2):
+        raise Exception('patchwork requires Django 3.2 or greater')
+
     from django.core.management import execute_from_command_line
 
     execute_from_command_line(sys.argv)
-- 
2.37.3



More information about the Patchwork mailing list