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