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