From b5769e6aabf6e42ffeb24f4a8edd88a54b11dd72 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 30 Sep 2022 14:04:19 +0100 Subject: [PATCH] manage: Check Django version on startup This was recently reported as an issue. Add a simple check to ensure people update their dependencies as expected. Signed-off-by: Stephen Finucane Cc: Siddhesh Poyarekar Cc: DJ Delorie Cc: Carlos O'Donell --- manage.py | 5 +++++ .../notes/check-django-on-startup-332acc16e7e8be8b.yaml | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml diff --git a/manage.py b/manage.py index 033c8ae4..d94e6118 100755 --- a/manage.py +++ b/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) diff --git a/releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml b/releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml new file mode 100644 index 00000000..12118529 --- /dev/null +++ b/releasenotes/notes/check-django-on-startup-332acc16e7e8be8b.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + The version of Django used is now checked on start-up. This can help avoid + issues where deployers forget to update their Django version and see odd + behavior as a result. -- 2.47.3