1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchPypi, 6 replaceVars, 7 geos_3_9, 8 gdal, 9 asgiref, 10 pytz, 11 sqlparse, 12 tzdata, 13 pythonOlder, 14 withGdal ? false, 15}: 16 17buildPythonPackage rec { 18 pname = "django"; 19 version = "3.2.25"; 20 21 disabled = pythonOlder "3.7"; 22 23 src = fetchPypi { 24 pname = "Django"; 25 inherit version; 26 hash = "sha256-fKOKeGVK7nI3hZTWPlFjbAS44oV09VBd/2MIlbVHJ3c="; 27 }; 28 29 patches = 30 [ 31 (replaceVars ./django_3_set_zoneinfo_dir.patch { 32 zoneinfo = tzdata + "/share/zoneinfo"; 33 }) 34 ] 35 ++ lib.optional withGdal ( 36 replaceVars ./django_3_set_geos_gdal_lib.patch { 37 inherit geos_3_9; 38 inherit gdal; 39 extension = stdenv.hostPlatform.extensions.sharedLibrary; 40 } 41 ); 42 43 propagatedBuildInputs = [ 44 asgiref 45 pytz 46 sqlparse 47 ]; 48 49 # too complicated to setup 50 doCheck = false; 51 52 pythonImportsCheck = [ "django" ]; 53 54 meta = with lib; { 55 description = "High-level Python Web framework"; 56 homepage = "https://www.djangoproject.com/"; 57 license = licenses.bsd3; 58 maintainers = with maintainers; [ georgewhewell ]; 59 knownVulnerabilities = [ 60 "Support for Django 3.2 ended on 2024-04-01, see https://www.djangoproject.com/download/#supported-versions." 61 ]; 62 }; 63}