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.2";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "0a1d195ad65c52bf275b8277b3d49680bd1137a5f55039a806f25f6b9752ce3d";
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 lsix ];
47 };
48}