gnu: python-django@2: Update to 2.2.27 [fixes CVE-2022-22818, CVE-2022-23833].
[jackhill/guix/guix.git] / gnu / packages / django.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
3 ;;; Copyright © 2016, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2017 Nikita <nikita@n0.is>
5 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com>
8 ;;; Copyright © 2019 Sam <smbaines8@gmail.com>
9 ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
10 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
11 ;;; Copyright © 2021 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages django)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix gexp)
34 #:use-module (guix build-system python)
35 #:use-module (guix deprecation)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages databases)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages finance)
42 #:use-module (gnu packages geo)
43 #:use-module (gnu packages openldap)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-build)
46 #:use-module (gnu packages python-crypto)
47 #:use-module (gnu packages python-web)
48 #:use-module (gnu packages python-xyz)
49 #:use-module (gnu packages sphinx)
50 #:use-module (gnu packages time)
51 #:use-module (gnu packages xml))
52
53 (define-public python-django-4.0
54 (package
55 (name "python-django")
56 (version "4.0.2")
57 (source (origin
58 (method url-fetch)
59 (uri (pypi-uri "Django" version))
60 (sha256
61 (base32
62 "0jlmxylag7dah9jl3wm2swnn9kbisx1gqnddfbh5kjifn67va3qi"))))
63 (build-system python-build-system)
64 (arguments
65 '(#:phases
66 (modify-phases %standard-phases
67 (add-before 'check 'pre-check
68 (lambda* (#:key inputs #:allow-other-keys)
69 ;; The test-suite tests timezone-dependent functions, thus tzdata
70 ;; needs to be available.
71 (setenv "TZDIR"
72 (search-input-directory inputs "share/zoneinfo"))
73
74 ;; Disable test for incorrect timezone: it only raises the
75 ;; expected error when /usr/share/zoneinfo exists, even though
76 ;; the machinery gracefully falls back to TZDIR. According to
77 ;; django/conf/__init__.py, lack of /usr/share/zoneinfo is
78 ;; harmless, so just ignore this test.
79 (substitute* "tests/settings_tests/tests.py"
80 ((".*def test_incorrect_timezone.*" all)
81 (string-append " @unittest.skipIf(True, 'Disabled by Guix')\n"
82 all)))))
83 (replace 'check
84 (lambda* (#:key tests? #:allow-other-keys)
85 (if tests?
86 (with-directory-excursion "tests"
87 ;; Tests expect PYTHONPATH to contain the root directory.
88 (setenv "PYTHONPATH" "..")
89 (invoke "python" "runtests.py"
90 ;; By default tests run in parallel, which may cause
91 ;; various race conditions. Run sequentially for
92 ;; consistent results.
93 "--parallel=1"))
94 (format #t "test suite not run~%"))))
95 ;; XXX: The 'wrap' phase adds native inputs as runtime dependencies,
96 ;; see <https://bugs.gnu.org/25235>. The django-admin script typically
97 ;; runs in an environment that has Django and its dependencies on
98 ;; PYTHONPATH, so just disable the wrapper to reduce the size from
99 ;; ~710 MiB to ~203 MiB.
100 (delete 'wrap))))
101 ;; TODO: Install extras/django_bash_completion.
102 (native-inputs
103 (list tzdata-for-tests
104 ;; Remaining packages are test requirements taken from
105 ;; tests/requirements/py3.txt
106 python-docutils
107 ;; optional for tests: ("python-geoip2" ,python-geoip2)
108 ;; optional for tests: ("python-memcached" ,python-memcached)
109 python-numpy
110 python-pillow
111 python-pyyaml
112 ;; optional for tests: ("python-selenium" ,python-selenium)
113 python-tblib))
114 (propagated-inputs
115 (list python-asgiref
116 python-sqlparse
117 ;; Optional dependencies.
118 python-argon2-cffi
119 python-bcrypt
120 ;; This input is not strictly required, but in practice many Django
121 ;; libraries need it for test suites and similar.
122 python-jinja2))
123 (native-search-paths
124 ;; Set TZDIR when 'tzdata' is available so that timezone functionality
125 ;; works (mostly) out of the box in containerized environments.
126 ;; Note: This search path actually belongs to 'glibc'.
127 (list (search-path-specification
128 (variable "TZDIR")
129 (files '("share/zoneinfo")))))
130 (home-page "https://www.djangoproject.com/")
131 (synopsis "High-level Python Web framework")
132 (description
133 "Django is a high-level Python Web framework that encourages rapid
134 development and clean, pragmatic design. It provides many tools for building
135 any Web site. Django focuses on automating as much as possible and adhering
136 to the @dfn{don't repeat yourself} (DRY) principle.")
137 (license license:bsd-3)
138 (properties `((cpe-name . "django")))))
139
140 (define-public python-django-3.2
141 (package
142 (inherit python-django-4.0)
143 (version "3.2.12")
144 (source (origin
145 (method url-fetch)
146 (uri (pypi-uri "Django" version))
147 (sha256
148 (base32
149 "1qj1kvb6mk2f4b33n4n5l4rh5kqllrk2v0v076crxr83ay9ycwlp"))))
150 (native-search-paths '()) ;no need for TZDIR
151 (propagated-inputs
152 (modify-inputs (package-propagated-inputs python-django-4.0)
153 ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
154 (append python-pytz)))))
155
156 (define-public python-django-2.2
157 (package
158 (inherit python-django-3.2)
159 (version "2.2.27")
160 (source (origin
161 (method url-fetch)
162 (uri (pypi-uri "Django" version))
163 (sha256
164 (base32
165 "04y9knxd8v9jn54ws5rbdwxyq5im69kx009s7gl62axzn1371qqy"))))
166 (native-inputs
167 (modify-inputs (package-native-inputs python-django-3.2)
168 (prepend ;; 2.2 requires Selenium for the test suite.
169 python-selenium)))))
170
171 ;; Use 3.2 LTS as the default until packages gain support for 4.x.
172 (define-public python-django python-django-3.2)
173
174 (define-public python-django-extensions
175 (package
176 (name "python-django-extensions")
177 (version "3.0.6")
178 (source
179 (origin
180 (method git-fetch)
181 ;; Fetch from the git repository, so that the tests can be run.
182 (uri (git-reference
183 (url "https://github.com/django-extensions/django-extensions")
184 (commit version)))
185 (file-name (string-append name "-" version))
186 (sha256
187 (base32
188 "0sra6hazqvspxd1pnx5cj7gia1rkaz3hn06ib4wd0frc167f5afy"))))
189 (build-system python-build-system)
190 (arguments
191 '(#:tests? #f)) ;XXX: requires a Postgres or MySQL database
192 (propagated-inputs
193 (list python-six python-vobject python-werkzeug python-dateutil
194 python-django))
195 (native-inputs
196 (list python-mock
197 python-factory-boy
198 python-tox
199 python-pytest
200 python-pytest-cov
201 python-pytest-django
202 python-shortuuid))
203 (home-page
204 "https://github.com/django-extensions/django-extensions")
205 (synopsis "Custom management extensions for Django")
206 (description
207 "Django-extensions extends Django providing, for example, management
208 commands, additional database fields and admin extensions.")
209 (license license:expat)))
210
211 (define-public python-django-localflavor
212 (package
213 (name "python-django-localflavor")
214 (version "3.1")
215 (source
216 (origin
217 (method url-fetch)
218 (uri (pypi-uri "django-localflavor" version))
219 (sha256
220 (base32 "0i1s0ijfd9rv2cp5x174jcyjpwn7fyg7s1wpbvlwm96bpdvs6bxc"))))
221 (build-system python-build-system)
222 (arguments
223 `(#:phases
224 (modify-phases %standard-phases
225 (replace 'check
226 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
227 (when tests?
228 (add-installed-pythonpath inputs outputs)
229 (setenv "PYTHONPATH"
230 (string-append ".:"
231 (getenv "GUIX_PYTHONPATH")))
232 (invoke "invoke" "test")))))))
233 (native-inputs
234 (list python-coverage python-invoke python-pytest-django which))
235 (propagated-inputs
236 (list python-django python-stdnum))
237 (home-page "https://django-localflavor.readthedocs.io/en/latest/")
238 (synopsis "Country-specific Django helpers")
239 (description "Django-LocalFlavor is a collection of assorted pieces of code
240 that are useful for particular countries or cultures.")
241 (license license:bsd-3)))
242
243 (define-public python-django-simple-math-captcha
244 (package
245 (name "python-django-simple-math-captcha")
246 (version "1.0.9")
247 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
248 (source (origin
249 (method git-fetch)
250 (uri (git-reference
251 (url home-page)
252 (commit (string-append "v" version))))
253 (file-name (git-file-name name version))
254 (sha256
255 (base32
256 "0fhy9k8haqa1296v0qpg1b5w7y3pyw9qi9z9laj5ijry1gk35qaw"))))
257 (build-system python-build-system)
258 (arguments
259 '(#:phases (modify-phases %standard-phases
260 (add-after 'unpack 'patch-six-imports
261 (lambda _
262 ;; Django no longer bundles six, adjust the imports
263 ;; accordingly. The six dependency can likely be
264 ;; removed in the next version.
265 (substitute* (find-files "." "\\.py$")
266 (("from django\\.utils import six")
267 "import six"))
268 #t))
269 (replace 'check
270 (lambda _
271 (invoke "python" "runtests.py"))))))
272 (native-inputs
273 (list python-mock))
274 (propagated-inputs
275 (list python-django python-six))
276 (synopsis "Easy-to-use math field/widget captcha for Django forms")
277 (description
278 "A multi-value-field that presents a human answerable question,
279 with no settings.py configuration necessary, but instead can be configured
280 with arguments to the field constructor.")
281 (license license:asl2.0)))
282
283 (define-public python-django-classy-tags
284 (package
285 (name "python-django-classy-tags")
286 (version "2.0.0")
287 (source
288 (origin
289 (method url-fetch)
290 (uri (pypi-uri "django-classy-tags" version))
291 (sha256
292 (base32
293 "1javam3zqi3y3j0r490mm61v48yh75jaha99gb7lsxkaz6yri7fm"))))
294 (build-system python-build-system)
295 ;; FIXME: How to make the test templates available to Django?
296 (arguments '(#:tests? #f))
297 (propagated-inputs
298 (list python-django))
299 (home-page "https://github.com/divio/django-classy-tags")
300 (synopsis "Class based template tags for Django")
301 (description
302 "@code{django-classy-tags} is an approach at making writing template tags
303 in Django easier, shorter and more fun. It provides an extensible argument
304 parser which reduces most of the boiler plate code you usually have to write
305 when coding custom template tags.")
306 (license license:bsd-3)))
307
308 (define-public python-django-taggit
309 (package
310 (name "python-django-taggit")
311 (version "1.3.0")
312 (source
313 (origin
314 (method url-fetch)
315 (uri (pypi-uri "django-taggit" version))
316 (sha256
317 (base32
318 "0bbkabbs77z229ps0800gxfhf75yagp4x4j5jzfysbac3zvkp0sa"))))
319 (build-system python-build-system)
320 (arguments
321 '(#:phases
322 (modify-phases %standard-phases
323 (replace 'check
324 (lambda _
325 (invoke "python3" "-m" "django" "test" "--settings=tests.settings"))))))
326 (propagated-inputs
327 (list python-django python-isort))
328 (native-inputs
329 (list python-pytest python-mock))
330 (home-page
331 "https://github.com/jazzband/django-taggit")
332 (synopsis
333 "Reusable Django application for simple tagging")
334 (description
335 "Django-taggit is a reusable Django application for simple tagging.")
336 (license license:bsd-3)))
337
338 (define-public python-easy-thumbnails
339 (package
340 (name "python-easy-thumbnails")
341 (version "2.7")
342 (source
343 (origin
344 (method url-fetch)
345 (uri (pypi-uri "easy-thumbnails" version))
346 (sha256
347 (base32
348 "14gzp5cv24z0qhxb7f7k7v9jgzpaj4n8yhjq83ynpx8183fs1rz4"))))
349 (build-system python-build-system)
350 (propagated-inputs
351 (list python-django python-pillow))
352 (home-page "https://github.com/SmileyChris/easy-thumbnails")
353 (synopsis "Easy thumbnails for Django")
354 (description
355 "Easy thumbnails is a Django plugin to dynamically create thumbnails
356 based on source images. Multiple thumbnails can be created from a single
357 source image, using different options to control parameters like the image
358 size and quality.")
359 (license license:bsd-3)))
360
361 (define-public python-pytest-django
362 (package
363 (name "python-pytest-django")
364 (version "4.4.0")
365 (source (origin
366 (method url-fetch)
367 (uri (pypi-uri "pytest-django" version))
368 (sha256
369 (base32
370 "0mglnz0w6k7dgw1jn6giv56pmdjd6a3zwwkhxb2kyzmzk0viw5xm"))))
371 (build-system python-build-system)
372 (arguments
373 ;; The test suite is disabled because there are many test failures (see:
374 ;; https://github.com/pytest-dev/pytest-django/issues/943).
375 `(#:tests? #f
376 #:phases
377 (modify-phases %standard-phases
378 (replace 'check
379 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
380 (if tests?
381 (begin
382 (setenv "PYTEST_DJANGO_TEST_RUNNER" "pytest")
383 (setenv "DJANGO_SETTINGS_MODULE"
384 "pytest_django_test.settings_sqlite_file")
385 (invoke "python" "-m" "pytest" "-vv" "-k"
386 ;; FIXME: these tests fail to locate Django templates ...
387 (string-append "not test_django_not_loaded_without_settings"
388 " and not test_settings"
389 ;; ... and this does not discover
390 ;; 'pytest_django_test'.
391 " and not test_urls_cache_is_cleared")))
392 (format #t "test suite not run~%")))))))
393 (native-inputs
394 (list python-django python-setuptools-scm
395 ;; For tests.
396 python-pytest-xdist-next))
397 (propagated-inputs
398 (list python-pytest))
399 (home-page "https://pytest-django.readthedocs.org/")
400 (synopsis "Django plugin for py.test")
401 (description "Pytest-django is a plugin for py.test that provides a set of
402 useful tools for testing Django applications and projects.")
403 (license license:bsd-3)))
404
405 (define-public python-django-haystack
406 (package
407 (name "python-django-haystack")
408 (version "3.1.1")
409 (source
410 (origin
411 (method url-fetch)
412 (uri (pypi-uri "django-haystack" version))
413 (sha256
414 (base32
415 "10kaa5641cakpra2x3jqgys085gdkjcyns26plfyrmfpjmmpa1bd"))))
416 (build-system python-build-system)
417 (arguments
418 '(#:phases
419 (modify-phases %standard-phases
420 (add-after 'unpack 'loosen-verion-restrictions
421 (lambda _
422 (substitute* "setup.py"
423 (("geopy.*") "geopy\",\n"))))
424 (add-before 'check 'set-gdal-lib-path
425 (lambda* (#:key inputs #:allow-other-keys)
426 (setenv "GDAL_LIBRARY_PATH"
427 (string-append (assoc-ref inputs "gdal")
428 "/lib"))))
429 ;; Importing this module requires setting up a Django project.
430 (delete 'sanity-check))
431 #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file
432 (propagated-inputs
433 (list python-django))
434 (native-inputs
435 (list gdal
436 python-coverage
437 python-dateutil
438 python-geopy
439 python-mock
440 python-nose
441 python-requests
442 python-setuptools-scm
443 python-pysolr
444 python-whoosh))
445 (home-page "http://haystacksearch.org/")
446 (synopsis "Pluggable search for Django")
447 (description "Haystack provides modular search for Django. It features a
448 unified, familiar API that allows you to plug in different search backends
449 (such as Solr, Elasticsearch, Whoosh, Xapian, etc.) without having to modify
450 your code.")
451 (license license:bsd-3)))
452
453 (define-public python-django-filter
454 (package
455 (name "python-django-filter")
456 (version "2.3.0")
457 (source (origin
458 (method url-fetch)
459 (uri (pypi-uri "django-filter" version))
460 (sha256
461 (base32
462 "1bz5qzdk9pk4a2lp2yacrdnqmkv24vxnz4k3lykrnpc3b7bkvrhi"))))
463 (build-system python-build-system)
464 (arguments
465 '(#:phases
466 (modify-phases %standard-phases
467 (replace 'check
468 (lambda _
469 (invoke "python" "runtests.py"))))))
470 (native-inputs
471 (list python-django python-django-rest-framework
472 python-django-crispy-forms python-mock))
473 (home-page "https://django-filter.readthedocs.io/en/latest/")
474 (synopsis "Reusable Django application to filter querysets dynamically")
475 (description
476 "Django-filter is a generic, reusable application to alleviate writing
477 some of the more mundane bits of view code. Specifically, it allows users to
478 filter down a queryset based on a model’s fields, displaying the form to let
479 them do this.")
480 (license license:bsd-3)))
481
482 (define-public python-django-allauth
483 (package
484 (name "python-django-allauth")
485 (version "0.42.0")
486 (source
487 (origin
488 (method url-fetch)
489 (uri (pypi-uri "django-allauth" version))
490 (sha256
491 (base32
492 "0c0x8izvrnjhrr48w6pwsfk9ddbi6yfxg7v3hh5dm1vz1d0hjwpi"))))
493 (build-system python-build-system)
494 (arguments
495 '(#:phases
496 (modify-phases %standard-phases
497 (replace 'check
498 (lambda _
499 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
500 (invoke "django-admin" "test" "allauth.tests"
501 "--pythonpath=."))))))
502 (propagated-inputs
503 (list python-openid python-requests python-requests-oauthlib))
504 (native-inputs
505 (list python-mock))
506 (inputs
507 (list python-django))
508 (home-page "https://github.com/pennersr/django-allauth")
509 (synopsis "Set of Django applications addressing authentication")
510 (description
511 "Integrated set of Django applications addressing authentication,
512 registration, account management as well as 3rd party (social)
513 account authentication.")
514 (license license:expat)))
515
516 (define-public python-django-debug-toolbar
517 (package
518 (name "python-django-debug-toolbar")
519 (version "3.2.1")
520 (source
521 (origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "https://github.com/jazzband/django-debug-toolbar")
525 (commit version)))
526 (file-name (git-file-name name version))
527 (sha256
528 (base32
529 "1m1j2sx7q0blma0miswj3c8hrfi5q4y5cq2b816v8gagy89xgc57"))))
530 (build-system python-build-system)
531 (propagated-inputs
532 (list python-sqlparse python-django))
533 (native-inputs
534 (list python-django-jinja python-html5lib))
535 (arguments
536 '(#:phases
537 (modify-phases %standard-phases
538 (replace 'check
539 (lambda _
540 (invoke "make" "test"))))))
541 (home-page
542 "https://github.com/jazzband/django-debug-toolbar")
543 (synopsis "Toolbar to help with developing Django applications")
544 (description
545 "A configurable set of panels that display information about the current
546 request and response as a toolbar on the rendered page.")
547 (license license:bsd-3)))
548
549 (define-public python-django-debug-toolbar-alchemy
550 (package
551 (name "python-django-debug-toolbar-alchemy")
552 (version "0.1.5")
553 (home-page "https://github.com/miki725/django-debug-toolbar-alchemy")
554 (source (origin
555 (method url-fetch)
556 (uri (pypi-uri "django-debug-toolbar-alchemy" version))
557 (sha256
558 (base32
559 "1kmpzghnsc247bc1dl22s4y62k9ijgy1pjms227018h5a4frsa5b"))))
560 (build-system python-build-system)
561 (arguments '(#:tests? #f)) ;XXX: 'make check' does "echo TODO"
562 (propagated-inputs
563 (list python-django python-django-debug-toolbar python-jsonplus
564 python-six python-sqlalchemy))
565 (synopsis "Django Debug Toolbar panel for SQLAlchemy")
566 (description
567 "This package completely mimics the default Django Debug Toolbar SQL
568 panel (internally it is actually subclassed), but instead of displaying
569 queries done via the Django ORM, SQLAlchemy generated queries are displayed.")
570 (license license:expat)))
571
572 (define-public python-django-gravatar2
573 (package
574 (name "python-django-gravatar2")
575 (version "1.4.4")
576 (source
577 (origin
578 (method url-fetch)
579 (uri (pypi-uri "django-gravatar2" version))
580 (sha256
581 (base32
582 "1vn921fb6jjx7rf5dzhy66rkb71nwmh9ydd0xs9ys72icw4jh4y8"))))
583 (build-system python-build-system)
584 (arguments
585 '(;; TODO: The django project for the tests is missing from the release.
586 #:tests? #f))
587 (inputs
588 (list python-django))
589 (home-page "https://github.com/twaddington/django-gravatar")
590 (synopsis "Gravatar support for Django, improved version")
591 (description
592 "Essential Gravatar support for Django. Features helper methods,
593 templatetags and a full test suite.")
594 (license license:expat)))
595
596 (define-public python-django-assets
597 (package
598 (name "python-django-assets")
599 (version "2.0")
600 (source (origin
601 (method url-fetch)
602 (uri (pypi-uri "django-assets" version))
603 (sha256
604 (base32
605 "0fc6i77faxxv1gjlp06lv3kw64b5bhdiypaygfxh5djddgk83fwa"))))
606 (build-system python-build-system)
607 (native-inputs
608 (list python-nose))
609 (propagated-inputs
610 (list python-django python-webassets))
611 (home-page "https://github.com/miracle2k/django-assets")
612 (synopsis "Asset management for Django")
613 (description
614 "Asset management for Django, to compress and merge CSS and Javascript
615 files. Integrates the webassets library with Django, adding support for
616 merging, minifying and compiling CSS and Javascript files.")
617 (license license:bsd-2)))
618
619 (define-public python-django-jinja
620 (package
621 (name "python-django-jinja")
622 (version "2.9.1")
623 (source
624 (origin
625 (method git-fetch)
626 (uri (git-reference
627 (url "https://github.com/niwinz/django-jinja")
628 (commit version)))
629 (file-name (git-file-name name version))
630 (sha256
631 (base32
632 "0p9pkn6jjzagpnvcrl9c2vjqamkms7ymvyhhmaqqqhrlv89qnzp7"))))
633 (build-system python-build-system)
634 (propagated-inputs
635 (list python-django python-jinja2 python-pytz python-django-pipeline))
636 (arguments
637 '(;; TODO Tests currently fail due to issues with the configuration for
638 ;; django-pipeline
639 #:tests? #f
640 #:phases
641 (modify-phases %standard-phases
642 (replace 'check
643 (lambda* (#:key tests? #:allow-other-keys)
644 (or
645 (not tests?)
646 (with-directory-excursion "testing"
647 (invoke "python" "runtests.py"))))))))
648 (home-page
649 "https://niwinz.github.io/django-jinja/latest/")
650 (synopsis "Simple jinja2 templating backend for Django")
651 (description
652 "This package provides a templating backend for Django, using Jinja2. It
653 provides certain advantages over the builtin Jinja2 backend in Django, for
654 example, explicit calls to callables from templates and better performance.")
655 (license license:bsd-3)))
656
657 (define-public python-dj-database-url
658 (package
659 (name "python-dj-database-url")
660 (version "0.5.0")
661 (source (origin
662 (method url-fetch)
663 (uri (pypi-uri "dj-database-url" version))
664 (sha256
665 (base32
666 "0qs16g5y3lflxibsl8gwkwap21crhmmv98l60rdq6x1wawgypsja"))))
667 (build-system python-build-system)
668 (home-page "https://github.com/kennethreitz/dj-database-url")
669 (synopsis "Use Database URLs in your Django Application")
670 (description
671 "This simple Django utility allows you to utilize the 12factor inspired
672 DATABASE_URL environment variable to configure your Django application.
673
674 The dj_database_url.config method returns a Django database connection
675 dictionary, populated with all the data specified in your URL. There is also a
676 conn_max_age argument to easily enable Django’s connection pool.")
677 (license license:bsd-2)))
678
679 (define-public python-django-picklefield
680 (package
681 (name "python-django-picklefield")
682 (version "3.0.1")
683 (home-page "https://github.com/gintas/django-picklefield")
684 ;; Use a git checkout because the PyPI release lacks tests.
685 (source
686 (origin
687 (method git-fetch)
688 (uri (git-reference
689 (url home-page)
690 (commit (string-append "v" version))))
691 (file-name (git-file-name name version))
692 (sha256
693 (base32
694 "0ni7bc86k0ra4pc8zv451pzlpkhs1nyil1sq9jdb4m2mib87b5fk"))))
695 (build-system python-build-system)
696 (arguments
697 '(#:phases (modify-phases %standard-phases
698 (replace 'check
699 (lambda _
700 (invoke "python" "-m" "django" "test" "-v2"
701 "--settings=tests.settings"))))))
702 (propagated-inputs
703 ;; XXX: Picklefield has not been updated in 10+ years and fails tests
704 ;; with Django 3.2.
705 `(("python-django@2.2" ,python-django-2.2)))
706 (synopsis "Pickled object field for Django")
707 (description "Pickled object field for Django")
708 (license license:expat)))
709
710 (define-public python-django-bulk-update
711 (package
712 (name "python-django-bulk-update")
713 (version "2.2.0")
714 (source (origin
715 (method url-fetch)
716 (uri (pypi-uri "django-bulk-update" version))
717 (sha256
718 (base32
719 "0dxkmrm3skyw82i0qa8vklxw1ma1y308kh9w2hcnvhpacn5cxdss"))))
720 (build-system python-build-system)
721 (arguments
722 ;; XXX: Tests require a Postgres database.
723 `(#:tests? #f))
724 (propagated-inputs
725 (list python-django))
726 (home-page "https://github.com/aykut/django-bulk-update")
727 (synopsis "Simple bulk update over Django ORM or with helper function")
728 (description
729 "Simple bulk update over Django ORM or with helper function. This
730 project aims to bulk update given objects using one query over Django ORM.")
731 (license license:expat)))
732
733 (define-public python-django-contact-form
734 (package
735 (name "python-django-contact-form")
736 (version "1.9")
737 (source (origin
738 (method url-fetch)
739 (uri (pypi-uri "django-contact-form" version))
740 (sha256
741 (base32
742 "1my9hkrylckp5vfqg9b0kncrdlxjnwxll56sdciqn4v19i4wbq1y"))))
743 (build-system python-build-system)
744 (arguments
745 `(#:phases
746 (modify-phases %standard-phases
747 (replace 'check
748 (lambda _
749 (invoke "coverage" "run" "--source" "contact_form"
750 "runtests.py"))))))
751 (native-inputs
752 (list python-coverage))
753 (propagated-inputs
754 (list python-django))
755 (home-page "https://github.com/ubernostrum/django-contact-form")
756 (synopsis "Contact form for Django")
757 (description
758 "This application provides simple, extensible contact-form functionality
759 for Django sites.")
760 (license license:bsd-3)))
761
762 (define-public python-django-contrib-comments
763 (package
764 (name "python-django-contrib-comments")
765 (version "1.9.2")
766 (source (origin
767 (method url-fetch)
768 (uri (pypi-uri "django-contrib-comments" version))
769 (sha256
770 (base32
771 "0ccdiv784a5vnpfal36km4dyg12340rwhpr0riyy0k89wfnjn8yi"))))
772 (build-system python-build-system)
773 (propagated-inputs
774 (list python-django python-six))
775 (home-page "https://github.com/django/django-contrib-comments")
776 (synopsis "Comments framework")
777 (description
778 "Django used to include a comments framework; since Django 1.6 it's been
779 separated to a separate project. This is that project. This framework can be
780 used to attach comments to any model, so you can use it for comments on blog
781 entries, photos, book chapters, or anything else.")
782 (license license:bsd-3)))
783
784 (define-public python-django-pipeline
785 (package
786 (name "python-django-pipeline")
787 (version "2.0.5")
788 (source
789 (origin
790 (method url-fetch)
791 (uri (pypi-uri "django-pipeline" version))
792 (sha256
793 (base32
794 "19vrbd5s12qw4qlg5n8ldv7zz2rs5y2sdid1i7lvgp92m71dayvc"))))
795 (build-system python-build-system)
796 (arguments
797 '(#:phases
798 (modify-phases %standard-phases
799 (add-after 'unpack 'patch-source
800 (lambda _
801 (substitute* "tests/tests/test_compiler.py"
802 (("\\/usr\\/bin\\/env")
803 (which "env")))))
804 (replace 'check
805 (lambda*(#:key tests? #:allow-other-keys)
806 (when tests?
807 (setenv "DJANGO_SETTINGS_MODULE" "tests.settings")
808 (invoke "django-admin" "test" "tests"
809 "--pythonpath=.")))))))
810 (propagated-inputs
811 (list python-css-html-js-minify python-django python-slimit
812 python-jsmin))
813 (home-page
814 "https://github.com/jazzband/django-pipeline")
815 (synopsis "Asset packaging library for Django")
816 (description
817 "Pipeline is an asset packaging library for Django, providing both CSS
818 and JavaScript concatenation and compression, built-in JavaScript template
819 support, and optional data-URI image and font embedding.")
820 (license license:expat)))
821
822 (define-public python-django-redis
823 (package
824 (name "python-django-redis")
825 (version "4.12.1")
826 (source (origin
827 (method url-fetch)
828 (uri (pypi-uri "django-redis" version))
829 (sha256
830 (base32
831 "0qvsm8yjchl0d3i7g20wba6px9lb5gv8kp3fcnr6hr0y0b3qjr9h"))))
832 (build-system python-build-system)
833 (arguments
834 `(#:phases
835 (modify-phases %standard-phases
836 (replace 'check
837 (lambda _
838 (invoke "redis-server" "--daemonize" "yes")
839 (with-directory-excursion "tests"
840 (invoke "python" "runtests.py")))))))
841 (native-inputs
842 (list python-fakeredis python-hiredis python-mock python-msgpack
843 redis))
844 (propagated-inputs
845 (list python-django python-redis))
846 (home-page "https://github.com/niwibe/django-redis")
847 (synopsis "Full featured redis cache backend for Django")
848 (description
849 "Full featured redis cache backend for Django.")
850 (license license:bsd-3)))
851
852 (define-public python-django-rq
853 (package
854 (name "python-django-rq")
855 (version "2.3.2")
856 (source (origin
857 (method url-fetch)
858 (uri (pypi-uri "django-rq" version))
859 (sha256
860 (base32
861 "0lksnjn3q3f7y72bj2yr8870w28a5b6x0vjnd9nhpq2ah6xfz6pf"))))
862 (build-system python-build-system)
863 (arguments
864 `(#:phases
865 (modify-phases %standard-phases
866 (replace 'check
867 (lambda _
868 (invoke "redis-server" "--daemonize" "yes")
869 (invoke "django-admin.py" "test" "django_rq"
870 "--settings=django_rq.tests.settings"
871 "--pythonpath=."))))))
872 (native-inputs
873 (list python-django-redis python-mock python-rq-scheduler redis))
874 (propagated-inputs
875 (list python-django python-rq))
876 (home-page "https://github.com/ui/django-rq")
877 (synopsis "Django integration with RQ")
878 (description
879 "Django integration with RQ, a Redis based Python queuing library.
880 Django-RQ is a simple app that allows you to configure your queues in django's
881 settings.py and easily use them in your project.")
882 (license license:expat)))
883
884 (define-public python-django-q
885 (package
886 (name "python-django-q")
887 (version "1.3.4")
888 (source
889 (origin
890 (method url-fetch)
891 (uri (pypi-uri "django-q" version))
892 (sha256
893 (base32 "03z1pf6wlf47i7afr79a8fiiidfk1vq19yaqnv0m4qdny7f58gaj"))))
894 (build-system python-build-system)
895 ;; FIXME: Tests require disque, Redis, MongoDB, Docker.
896 (arguments '(#:tests? #f))
897 (propagated-inputs
898 (list python-arrow python-blessed python-django
899 python-django-picklefield))
900 (home-page "https://django-q.readthedocs.io/")
901 (synopsis "Multiprocessing distributed task queue for Django")
902 (description
903 "Django Q is a native Django task queue, scheduler and worker application
904 using Python multiprocessing.")
905 (license license:expat)))
906
907 (define-public python-django-sortedm2m
908 (package
909 (name "python-django-sortedm2m")
910 (version "3.0.2")
911 (source (origin
912 (method url-fetch)
913 (uri (pypi-uri "django-sortedm2m" version))
914 (sha256
915 (base32
916 "0z0yymmrr2l5cznqbzwziw624df0qsiflvbpqwrpan52nww3dk4a"))))
917 (build-system python-build-system)
918 (arguments
919 `(#:phases (modify-phases %standard-phases
920 (replace 'check
921 (lambda _
922 (invoke "django-admin"
923 "test" "--settings=test_project.settings"
924 "--pythonpath=."))))))
925 (propagated-inputs
926 (list python-django))
927 (home-page "https://github.com/jazzband/django-sortedm2m")
928 (synopsis "Drop-in replacement for django's own ManyToManyField")
929 (description
930 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
931 The provided SortedManyToManyField behaves like the original one but remembers
932 the order of added relations.")
933 (license license:bsd-3)))
934
935 (define-public python-django-appconf
936 (package
937 (name "python-django-appconf")
938 (version "1.0.4")
939 (source (origin
940 (method url-fetch)
941 (uri (pypi-uri "django-appconf" version))
942 (sha256
943 (base32
944 "101k8nkc7xlffpjdi2qbrp9pc4v8hzvmkzi12qp7vms39asxwn5y"))))
945 (build-system python-build-system)
946 (arguments
947 '(#:phases (modify-phases %standard-phases
948 (replace 'check
949 (lambda _
950 (setenv "DJANGO_SETTINGS_MODULE" "tests.test_settings")
951 (invoke "django-admin" "test" "--pythonpath=."))))))
952 (propagated-inputs
953 (list python-django))
954 (home-page "https://github.com/django-compressor/django-appconf")
955 (synopsis "Handle configuration defaults of packaged Django apps")
956 (description
957 "This app precedes Django's own AppConfig classes that act as \"objects
958 [to] store metadata for an application\" inside Django's app loading mechanism.
959 In other words, they solve a related but different use case than
960 django-appconf and can't easily be used as a replacement. The similarity in
961 name is purely coincidental.")
962 (license license:bsd-3)))
963
964 (define-public python-django-statici18n
965 (package
966 (name "python-django-statici18n")
967 (version "2.1.0")
968 (home-page "https://github.com/zyegfryed/django-statici18n")
969 (source (origin
970 (method git-fetch)
971 (uri (git-reference
972 (url home-page)
973 (commit (string-append "v" version))))
974 (file-name (git-file-name name version))
975 (sha256
976 (base32
977 "0x0xvfqd40is2ks43d65awgqkx3wk10lvdim15scvbjhkh301b6v"))))
978 (build-system python-build-system)
979 (arguments
980 '(#:phases (modify-phases %standard-phases
981 (replace 'check
982 (lambda _
983 (setenv "PYTHONPATH" "./tests/test_project")
984 (setenv "DJANGO_SETTINGS_MODULE" "project.settings")
985 (invoke "pytest" "-vv"))))))
986 (native-inputs
987 (list python-pytest python-pytest-django))
988 (propagated-inputs
989 `(("python-django" ,python-django)
990 ("django-appconf" ,python-django-appconf)))
991 (synopsis "Generate JavaScript catalog to static files")
992 (description
993 "A Django app that provides helper for generating JavaScript catalog to
994 static files.")
995 (license license:bsd-3)))
996
997 (define-public python-django-tagging
998 (package
999 (name "python-django-tagging")
1000 (version "0.5.0")
1001 (source
1002 (origin
1003 (method url-fetch)
1004 (uri (pypi-uri "django-tagging" version))
1005 (sha256
1006 (base32
1007 "13afxx30chssclxzd9gqnvwm9qyrdpnlbs6iswdfa18phfj8zmi8"))))
1008 (build-system python-build-system)
1009 (arguments
1010 `(#:phases
1011 (modify-phases %standard-phases
1012 (replace 'check
1013 (lambda _
1014 (setenv "DJANGO_SETTINGS_MODULE" "tagging.tests.settings")
1015 (invoke "django-admin" "test" "--pythonpath=."))))))
1016 (inputs
1017 (list python-django))
1018 (home-page "https://github.com/Fantomas42/django-tagging")
1019 (synopsis "Generic tagging application for Django")
1020 (description "This package provides a generic tagging application for
1021 Django projects, which allows association of a number of tags with any
1022 @code{Model} instance and makes retrieval of tags simple.")
1023 (license license:bsd-3)))
1024
1025 (define-public python-django-rest-framework
1026 (package
1027 (name "python-django-rest-framework")
1028 (version "3.13.1")
1029 (source
1030 (origin
1031 (method git-fetch)
1032 (uri (git-reference
1033 (url "https://github.com/encode/django-rest-framework")
1034 (commit version)))
1035 (file-name (git-file-name name version))
1036 (sha256
1037 (base32
1038 "11wfb156yin6mlgcdzfmi267jsq1cld131mxgd13aqsrj06zlray"))))
1039 (build-system python-build-system)
1040 (arguments
1041 '(#:phases
1042 (modify-phases %standard-phases
1043 (replace 'check
1044 (lambda* (#:key tests? inputs #:allow-other-keys)
1045 (if tests?
1046 (invoke "python" "runtests.py")
1047 (format #t "test suite not run~%")))))))
1048 (native-inputs
1049 (list python-pytest python-pytest-django tzdata-for-tests))
1050 (propagated-inputs
1051 (list python-django python-pytz))
1052 (home-page "https://www.django-rest-framework.org")
1053 (synopsis "Toolkit for building Web APIs with Django")
1054 (description
1055 "The Django REST framework is for building Web APIs with Django. It
1056 provides features like a Web-browsable API and authentication policies.")
1057 (license license:bsd-2)))
1058
1059 (define-public python-djangorestframework
1060 (deprecated-package "python-djangorestframework" python-django-rest-framework))
1061
1062 (define-public python-django-sekizai
1063 (package
1064 (name "python-django-sekizai")
1065 (version "2.0.0")
1066 (source
1067 (origin
1068 (method url-fetch)
1069 (uri (pypi-uri "django-sekizai" version))
1070 (sha256
1071 (base32
1072 "0vrkli625b5s1wldri3dyrfvqbxg7zxy2pg0rpjixw3b1ndz0ag8"))))
1073 (build-system python-build-system)
1074 (arguments '(#:tests? #f)) ; Tests not included with release.
1075 (propagated-inputs
1076 (list python-django python-django-classy-tags python-six))
1077 (home-page "https://github.com/divio/django-sekizai")
1078 (synopsis "Template blocks for Django projects")
1079 (description "Sekizai means blocks in Japanese, and that is what this app
1080 provides. A fresh look at blocks. With @code{django-sekizai} you can define
1081 placeholders where your blocks get rendered and at different places in your
1082 templates append to those blocks. This is especially useful for css and
1083 javascript. Your subtemplates can now define css and javscript files to be
1084 included, and the css will be nicely put at the top and the javascript to the
1085 bottom, just like you should. Also sekizai will ignore any duplicate content in
1086 a single block.")
1087 (license license:bsd-3)))
1088
1089 (define-public python-django-crispy-forms
1090 (package
1091 (name "python-django-crispy-forms")
1092 (version "1.9.2")
1093 (source
1094 (origin
1095 (method url-fetch)
1096 (uri (pypi-uri "django-crispy-forms" version))
1097 (sha256
1098 (base32
1099 "0fxlf233f49hjax786p4r650rd0ilvhnpyvw8hv1d1aqnkxy1wgj"))))
1100 (build-system python-build-system)
1101 (arguments
1102 '(;; No included tests
1103 #:tests? #f))
1104 (propagated-inputs
1105 (list python-django))
1106 (home-page
1107 "http://github.com/maraujop/django-crispy-forms")
1108 (synopsis "Tool to control Django forms without custom templates")
1109 (description
1110 "@code{django-crispy-forms} lets you easily build, customize and reuse
1111 forms using your favorite CSS framework, without writing template code.")
1112 (license license:expat)))
1113
1114 (define-public python-django-compressor
1115 (package
1116 (name "python-django-compressor")
1117 (version "2.4.1")
1118 (source
1119 (origin
1120 (method url-fetch)
1121 (uri (pypi-uri "django_compressor" version))
1122 (sha256
1123 (base32 "1q0m0hfg7sqmj5km924g4dgy3nx51aszzsprlp6gsin10mv0fn1k"))))
1124 (build-system python-build-system)
1125 (arguments
1126 '(#:phases
1127 (modify-phases %standard-phases
1128 (replace 'check
1129 (lambda* (#:key tests? #:allow-other-keys)
1130 (if tests?
1131 (begin
1132 (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
1133 (invoke "django-admin" "test"
1134 "--pythonpath=."))
1135 #t))))
1136 ;; Tests fail with beautifulsoup 4.9+
1137 ;; https://github.com/django-compressor/django-compressor/issues/998
1138 #:tests? #f))
1139 (propagated-inputs
1140 (list python-django-appconf python-rcssmin python-rjsmin))
1141 (native-inputs
1142 (list python-beautifulsoup4 python-brotli python-csscompressor
1143 python-django-sekizai python-mock))
1144 (home-page "https://django-compressor.readthedocs.io/en/latest/")
1145 (synopsis
1146 "Compress linked and inline JavaScript or CSS into single cached files")
1147 (description
1148 "Django Compressor combines and compresses linked and inline Javascript or
1149 CSS in a Django templates into cacheable static files by using the compress
1150 template tag.")
1151 (license license:expat)))
1152
1153 (define-public python-django-override-storage
1154 (package
1155 (name "python-django-override-storage")
1156 (version "0.3.0")
1157 (home-page "https://github.com/danifus/django-override-storage")
1158 (source
1159 (origin
1160 (method git-fetch)
1161 (uri (git-reference
1162 (url home-page)
1163 (commit (string-append "v" version))))
1164 (file-name (git-file-name name version))
1165 (sha256
1166 (base32 "081kzfk7mmybhihvc92d3hsdg0r2k20ydq88fs1fgd348sq1ax51"))))
1167 (build-system python-build-system)
1168 (arguments
1169 '(#:phases (modify-phases %standard-phases
1170 (replace 'check
1171 (lambda _
1172 (invoke "python" "runtests.py"))))))
1173 (native-inputs
1174 (list python-mock))
1175 (propagated-inputs
1176 (list python-django))
1177 (synopsis "Django test helpers to manage file storage side effects")
1178 (description
1179 "This project provides tools to help reduce the side effects of using
1180 FileFields during tests.")
1181 (license license:expat)))
1182
1183 (define-public python-django-auth-ldap
1184 (package
1185 (name "python-django-auth-ldap")
1186 (version "4.0.0")
1187 (source (origin
1188 (method url-fetch)
1189 (uri (pypi-uri "django-auth-ldap" version))
1190 (sha256
1191 (base32
1192 "0fajn4bk7m1hk0mjz97q7vlfzh7ibzv8f4qn7zhkq26f4kk7jvr7"))))
1193 (build-system python-build-system)
1194 (arguments
1195 (list #:phases
1196 #~(modify-phases %standard-phases
1197 (replace 'build
1198 (lambda _
1199 ;; Set file modification times to the early 80's because
1200 ;; the Zip format does not support earlier timestamps.
1201 (setenv "SOURCE_DATE_EPOCH"
1202 (number->string (* 10 366 24 60 60)))
1203 (invoke "python" "-m" "build" "--wheel"
1204 "--no-isolation" ".")))
1205 (replace 'check
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (setenv "SLAPD" (search-input-file inputs "/libexec/slapd"))
1208 (setenv "SCHEMA"
1209 (search-input-directory inputs "etc/openldap/schema"))
1210 (invoke "python" "-m" "django" "test"
1211 "--settings" "tests.settings")))
1212 (replace 'install
1213 (lambda _
1214 (let ((whl (car (find-files "dist" "\\.whl$"))))
1215 (invoke "pip" "--no-cache-dir" "--no-input"
1216 "install" "--no-deps" "--prefix" #$output whl)))))))
1217 (native-inputs
1218 (list openldap-2.6 python-wheel python-setuptools-scm python-toml
1219
1220 ;; These can be removed after <https://bugs.gnu.org/46848>.
1221 python-pypa-build python-pip))
1222 (propagated-inputs
1223 (list python-django python-ldap))
1224 (home-page "https://github.com/django-auth-ldap/django-auth-ldap")
1225 (synopsis "Django LDAP authentication backend")
1226 (description
1227 "This package provides an LDAP authentication backend for Django.")
1228 (license license:bsd-2)))
1229
1230 (define-public python-django-logging-json
1231 (package
1232 (name "python-django-logging-json")
1233 (version "1.15")
1234 (source (origin
1235 (method url-fetch)
1236 (uri (pypi-uri "django-logging-json" version))
1237 (sha256
1238 (base32
1239 "06041a8icazzp73kg93c7k1ska12wvkq7fpcad0l0sm1qnxx5yx7"))))
1240 (build-system python-build-system)
1241 (arguments
1242 '(#:tests? #f ;no tests
1243 #:phases (modify-phases %standard-phases
1244 ;; Importing this module requires a Django project.
1245 (delete 'sanity-check))))
1246 (propagated-inputs
1247 (list python-certifi python-django python-elasticsearch python-six))
1248 (home-page "https://github.com/cipriantarta/django-logging")
1249 (synopsis "Log requests/responses in various formats")
1250 (description
1251 "This package provides a Django library that logs request, response,
1252 and exception details in a JSON document. It can also send logs directly
1253 to ElasticSearch.")
1254 (license license:bsd-2)))
1255
1256 (define-public python-django-netfields
1257 (package
1258 (name "python-django-netfields")
1259 (version "1.2.4")
1260 (source (origin
1261 (method url-fetch)
1262 (uri (pypi-uri "django-netfields" version))
1263 (sha256
1264 (base32
1265 "0jwlbyaxk91fq69g2y0zpfjgmjgh6l0lqm5mhys7m5968lkihvgp"))))
1266 (build-system python-build-system)
1267 (arguments '(#:tests? #f)) ;XXX: Requires a running PostgreSQL server
1268 (propagated-inputs
1269 (list python-django python-netaddr python-psycopg2 python-six))
1270 (home-page "https://github.com/jimfunk/django-postgresql-netfields")
1271 (synopsis "PostgreSQL netfields implementation for Django")
1272 (description
1273 "This package provides mappings for the PostgreSQL @code{INET} and
1274 @code{CIDR} fields for use in Django projects.")
1275 (license license:bsd-3)))
1276
1277 (define-public python-django-url-filter
1278 (package
1279 (name "python-django-url-filter")
1280 (version "0.3.15")
1281 (home-page "https://github.com/miki725/django-url-filter")
1282 (source (origin
1283 (method git-fetch)
1284 (uri (git-reference (url home-page) (commit version)))
1285 (file-name (git-file-name name version))
1286 (sha256
1287 (base32
1288 "0r4zhqhs8y6cnplwyvcb0zpijizw1ifnszs38n4w8138657f9026"))
1289 (modules '((guix build utils)))
1290 (snippet
1291 ;; Patch for Django 4.0 compatibility, taken from upstream pull
1292 ;; request: https://github.com/miki725/django-url-filter/pull/103
1293 '(substitute* "url_filter/validators.py"
1294 ((" ungettext_lazy")
1295 " ngettext_lazy")))))
1296 (build-system python-build-system)
1297 (arguments
1298 '(#:tests? #f ;FIXME: Django raises "Apps aren't loaded yet"!?
1299 #:phases (modify-phases %standard-phases
1300 (add-after 'unpack 'loosen-requirements
1301 (lambda _
1302 ;; Do not depend on compatibility package for old
1303 ;; Python versions.
1304 (substitute* "requirements.txt"
1305 (("enum-compat") ""))))
1306 (replace 'check
1307 (lambda* (#:key tests? #:allow-other-keys)
1308 (if tests?
1309 (begin
1310 (setenv "DJANGO_SETTINGS_MODULE"
1311 "test_project.settings")
1312 (invoke "pytest" "-vv" "--doctest-modules"
1313 "tests/" "url_filter/"))
1314 (format #t "test suite not run~%")))))))
1315 (propagated-inputs
1316 (list python-cached-property python-django python-six))
1317 (synopsis "Filter data via human-friendly URLs")
1318 (description
1319 "The main goal of Django URL Filter is to provide an easy URL interface
1320 for filtering data. It allows the user to safely filter by model attributes
1321 and also specify the lookup type for each filter (very much like
1322 Django's filtering system in ORM).")
1323 (license license:expat)))
1324
1325 (define-public python-django-svg-image-form-field
1326 (package
1327 (name "python-django-svg-image-form-field")
1328 (version "1.0.1")
1329 (source
1330 (origin
1331 (method git-fetch)
1332 (uri (git-reference
1333 (url "https://github.com/artrey/django-svg-image-form-field")
1334 (commit (string-append version))))
1335 (file-name (git-file-name name version))
1336 (sha256
1337 (base32 "131m545khn8l20j4x2bvlvz36dlbnhj9pc98i2dw72s3bw8pgws0"))))
1338 (build-system python-build-system)
1339 (propagated-inputs
1340 (list python-defusedxml python-django python-pillow))
1341 (home-page "https://github.com/artrey/django-svg-image-form-field")
1342 (synopsis "Form field to validate SVG and other images")
1343 (description "This form field allows users to provide SVG images for
1344 models that use Django's standard @code{ImageField}, in addition to the
1345 image files already supported by it.")
1346 (license license:expat)))