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