From: Stephen Finucane Date: Fri, 30 Sep 2022 13:04:19 +0000 (+0100) Subject: manage: Check Django version on startup X-Git-Tag: v3.2.0~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5769e6aabf6e42ffeb24f4a8edd88a54b11dd72;p=thirdparty%2Fpatchwork.git 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 --- 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.