45 buildPythonPackage rec {
50 disabled = pythonOlder "3.8";
52 src = fetchFromGitHub {
55 rev = "refs/tags/${version}";
56 hash = "sha256-VW/qfqOadivtU8Xg70FLqENtOV7GqJM4bR2Ik6Yag+o=";
62 src = ./django_4_set_zoneinfo_dir.patch;
63 zoneinfo = tzdata + "/share/zoneinfo";
65 # make sure the tests don't remove packages from our pythonpath
66 # and disable failing tests
67 ./django_4_tests.patch
69 ++ lib.optionals withGdal [
71 src = ./django_4_set_geos_gdal_lib.patch;
74 extension = stdenv.hostPlatform.extensions.sharedLibrary;
80 substituteInPlace tests/utils_tests/test_autoreload.py \
81 --replace "/usr/bin/python" "${python.interpreter}"
83 + lib.optionalString (pythonAtLeast "3.12" && stdenv.hostPlatform.system == "aarch64-linux") ''
84 # Test regression after xz was reverted from 5.6.0 to 5.4.6
85 # https://hydra.nixos.org/build/254630990
86 substituteInPlace tests/view_tests/tests/test_debug.py \
87 --replace-fail "test_files" "dont_test_files"
90 nativeBuildInputs = [ setuptools ];
92 propagatedBuildInputs = [
97 optional-dependencies = {
98 argon2 = [ argon2-cffi ];
102 nativeCheckInputs = [
103 # tests/requirements/py3.txt
119 ] ++ lib.flatten (lib.attrValues optional-dependencies);
121 doCheck = !stdenv.hostPlatform.isDarwin;
124 # make sure the installed library gets imported
127 # provide timezone data, works only on linux
128 export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
135 ${python.interpreter} runtests.py --settings=test_sqlite
141 __darwinAllowLocalNetworking = true;
144 changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor version}/releases/${version}/";
145 description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design";
146 mainProgram = "django-admin";
147 homepage = "https://www.djangoproject.com";
148 license = licenses.bsd3;
149 maintainers = with maintainers; [ hexa ];