22 # optional-dependencies
45 buildPythonPackage rec {
50 disabled = pythonOlder "3.10";
55 hash = "sha256-S9AajIMLt3qKOw59iyW4h+U2rReoG6Lc5UdhNcczEr0=";
60 src = ./django_5_set_zoneinfo_dir.patch;
61 zoneinfo = tzdata + "/share/zoneinfo";
63 # prevent tests from messing with our pythonpath
64 ./django_5_tests_pythonpath.patch
65 # disable test that excpects timezone issues
66 ./django_5_disable_failing_tests.patch
69 # https://github.com/django/django/pull/17979
70 name = "django-mime-utf8-surrogates.patch";
71 url = "https://github.com/django/django/commit/b231bcd19e57267ce1fc21d42d46f0b65fdcfcf8.patch";
72 hash = "sha256-HhmRwi24VkoPoh+NygAThCoMywoMwrLijU4ZsDfVU34=";
75 ] ++ lib.optionals withGdal [
77 src = ./django_5_set_geos_gdal_lib.patch;
80 extension = stdenv.hostPlatform.extensions.sharedLibrary;
85 substituteInPlace tests/utils_tests/test_autoreload.py \
86 --replace "/usr/bin/python" "${python.interpreter}"
87 '' + lib.optionalString (pythonAtLeast "3.12" && stdenv.hostPlatform.system == "aarch64-linux") ''
88 # Test regression after xz was reverted from 5.6.0 to 5.4.6
89 # https://hydra.nixos.org/build/254532197
90 substituteInPlace tests/view_tests/tests/test_debug.py \
91 --replace-fail "test_files" "dont_test_files"
103 optional-dependencies = {
112 nativeCheckInputs = [
113 # tests/requirements/py3.txt
129 ] ++ lib.flatten (lib.attrValues optional-dependencies);
131 doCheck = !stdenv.isDarwin;
134 # make sure the installed library gets imported
137 # provide timezone data, works only on linux
138 export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
145 ${python.interpreter} runtests.py --settings=test_sqlite
151 __darwinAllowLocalNetworking = true;
154 changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor version}/releases/${version}/";
155 description = "A high-level Python Web framework that encourages rapid development and clean, pragmatic design.";
156 homepage = "https://www.djangoproject.com";
157 license = licenses.bsd3;
158 maintainers = with maintainers; [ hexa ];