gnu: python-django-pipeline: Fix tests.
[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 compression)
36 #:use-module (gnu packages databases)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages finance)
39 #:use-module (gnu packages geo)
40 #:use-module (gnu packages openldap)
41 #:use-module (gnu packages python)
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 ("python-django" ,python-django)))
171 (native-inputs
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 "GUIX_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-mock" ,python-mock)))
254 (propagated-inputs
255 `(("python-django" ,python-django)
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 (propagated-inputs
279 `(("python-django" ,python-django)))
280 (home-page "https://github.com/divio/django-classy-tags")
281 (synopsis "Class based template tags for Django")
282 (description
283 "@code{django-classy-tags} is an approach at making writing template tags
284 in Django easier, shorter and more fun. It provides an extensible argument
285 parser which reduces most of the boiler plate code you usually have to write
286 when coding custom template tags.")
287 (license license:bsd-3)))
288
289 (define-public python-django-taggit
290 (package
291 (name "python-django-taggit")
292 (version "1.3.0")
293 (source
294 (origin
295 (method url-fetch)
296 (uri (pypi-uri "django-taggit" version))
297 (sha256
298 (base32
299 "0bbkabbs77z229ps0800gxfhf75yagp4x4j5jzfysbac3zvkp0sa"))))
300 (build-system python-build-system)
301 (arguments
302 '(#:phases
303 (modify-phases %standard-phases
304 (replace 'check
305 (lambda _
306 (invoke "python3" "-m" "django" "test" "--settings=tests.settings"))))))
307 (propagated-inputs
308 `(("python-django" ,python-django)
309 ("python-isort" ,python-isort)))
310 (native-inputs
311 `(("python-pytest" ,python-pytest)
312 ("python-mock" ,python-mock)))
313 (home-page
314 "https://github.com/jazzband/django-taggit")
315 (synopsis
316 "Reusable Django application for simple tagging")
317 (description
318 "Django-taggit is a reusable Django application for simple tagging.")
319 (license license:bsd-3)))
320
321 (define-public python-easy-thumbnails
322 (package
323 (name "python-easy-thumbnails")
324 (version "2.7")
325 (source
326 (origin
327 (method url-fetch)
328 (uri (pypi-uri "easy-thumbnails" version))
329 (sha256
330 (base32
331 "14gzp5cv24z0qhxb7f7k7v9jgzpaj4n8yhjq83ynpx8183fs1rz4"))))
332 (build-system python-build-system)
333 (propagated-inputs
334 `(("python-django" ,python-django)
335 ("python-pillow" ,python-pillow)))
336 (home-page "https://github.com/SmileyChris/easy-thumbnails")
337 (synopsis "Easy thumbnails for Django")
338 (description
339 "Easy thumbnails is a Django plugin to dynamically create thumbnails
340 based on source images. Multiple thumbnails can be created from a single
341 source image, using different options to control parameters like the image
342 size and quality.")
343 (license license:bsd-3)))
344
345 (define-public python-pytest-django
346 (package
347 (name "python-pytest-django")
348 (version "4.4.0")
349 (source (origin
350 (method url-fetch)
351 (uri (pypi-uri "pytest-django" version))
352 (sha256
353 (base32
354 "0mglnz0w6k7dgw1jn6giv56pmdjd6a3zwwkhxb2kyzmzk0viw5xm"))))
355 (build-system python-build-system)
356 (arguments
357 ;; The test suite is disabled because there are many test failures (see:
358 ;; https://github.com/pytest-dev/pytest-django/issues/943).
359 `(#:tests? #f
360 #:phases
361 (modify-phases %standard-phases
362 (replace 'check
363 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
364 (if tests?
365 (begin
366 (setenv "PYTEST_DJANGO_TEST_RUNNER" "pytest")
367 (setenv "DJANGO_SETTINGS_MODULE"
368 "pytest_django_test.settings_sqlite_file")
369 (invoke "python" "-m" "pytest" "-vv" "-k"
370 ;; FIXME: these tests fail to locate Django templates ...
371 (string-append "not test_django_not_loaded_without_settings"
372 " and not test_settings"
373 ;; ... and this does not discover
374 ;; 'pytest_django_test'.
375 " and not test_urls_cache_is_cleared")))
376 (format #t "test suite not run~%")))))))
377 (native-inputs
378 `(("python-django" ,python-django)
379 ("python-setuptools-scm" ,python-setuptools-scm)
380 ;; For tests.
381 ("python-pytest-xdist" ,python-pytest-xdist-next)))
382 (propagated-inputs
383 `(("python-pytest" ,python-pytest)))
384 (home-page "https://pytest-django.readthedocs.org/")
385 (synopsis "Django plugin for py.test")
386 (description "Pytest-django is a plugin for py.test that provides a set of
387 useful tools for testing Django applications and projects.")
388 (license license:bsd-3)))
389
390 (define-public python-django-haystack
391 (package
392 (name "python-django-haystack")
393 (version "2.8.1")
394 (source
395 (origin
396 (method url-fetch)
397 (uri (pypi-uri "django-haystack" version))
398 (sha256
399 (base32
400 "1302fqsrx8w474xk5cmnmg3hjqfprlxnjg9qlg86arsr4v4vqm4b"))))
401 (build-system python-build-system)
402 (arguments
403 '(#:phases
404 (modify-phases %standard-phases
405 (add-after 'unpack 'loosen-verion-restrictions
406 (lambda _
407 (substitute* "setup.py"
408 (("geopy.*") "geopy',\n"))))
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 ;; Importing this module requires setting up a Django project.
415 (delete 'sanity-check))
416 #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file
417 (propagated-inputs
418 `(("python-django" ,python-django)))
419 (native-inputs
420 `(("gdal" ,gdal)
421 ("python-coverage" ,python-coverage)
422 ("python-dateutil" ,python-dateutil)
423 ("python-geopy" ,python-geopy)
424 ("python-mock" ,python-mock)
425 ("python-nose" ,python-nose)
426 ("python-requests" ,python-requests)
427 ("python-setuptools-scm" ,python-setuptools-scm)
428 ("python-pysolr" ,python-pysolr)
429 ("python-whoosh" ,python-whoosh)))
430 (home-page "http://haystacksearch.org/")
431 (synopsis "Pluggable search for Django")
432 (description "Haystack provides modular search for Django. It features a
433 unified, familiar API that allows you to plug in different search backends
434 (such as Solr, Elasticsearch, Whoosh, Xapian, etc.) without having to modify
435 your code.")
436 (license license:bsd-3)))
437
438 (define-public python-django-filter
439 (package
440 (name "python-django-filter")
441 (version "2.3.0")
442 (source (origin
443 (method url-fetch)
444 (uri (pypi-uri "django-filter" version))
445 (sha256
446 (base32
447 "1bz5qzdk9pk4a2lp2yacrdnqmkv24vxnz4k3lykrnpc3b7bkvrhi"))))
448 (build-system python-build-system)
449 (arguments
450 '(#:phases
451 (modify-phases %standard-phases
452 (replace 'check
453 (lambda _
454 (invoke "python" "runtests.py"))))))
455 (native-inputs
456 `(("python-django" ,python-django)
457 ("python-djangorestframework" ,python-djangorestframework)
458 ("python-django-crispy-forms" ,python-django-crispy-forms)
459 ("python-mock" ,python-mock)))
460 (home-page "https://django-filter.readthedocs.io/en/latest/")
461 (synopsis "Reusable Django application to filter querysets dynamically")
462 (description
463 "Django-filter is a generic, reusable application to alleviate writing
464 some of the more mundane bits of view code. Specifically, it allows users to
465 filter down a queryset based on a model’s fields, displaying the form to let
466 them do this.")
467 (license license:bsd-3)))
468
469 (define-public python-django-allauth
470 (package
471 (name "python-django-allauth")
472 (version "0.42.0")
473 (source
474 (origin
475 (method url-fetch)
476 (uri (pypi-uri "django-allauth" version))
477 (sha256
478 (base32
479 "0c0x8izvrnjhrr48w6pwsfk9ddbi6yfxg7v3hh5dm1vz1d0hjwpi"))))
480 (build-system python-build-system)
481 (arguments
482 '(#:phases
483 (modify-phases %standard-phases
484 (replace 'check
485 (lambda _
486 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
487 (invoke "django-admin" "test" "allauth.tests"
488 "--pythonpath=."))))))
489 (propagated-inputs
490 `(("python-openid" ,python-openid)
491 ("python-requests" ,python-requests)
492 ("python-requests-oauthlib" ,python-requests-oauthlib)))
493 (native-inputs
494 `(("python-mock" ,python-mock)))
495 (inputs
496 `(("python-django" ,python-django)))
497 (home-page "https://github.com/pennersr/django-allauth")
498 (synopsis "Set of Django applications addressing authentication")
499 (description
500 "Integrated set of Django applications addressing authentication,
501 registration, account management as well as 3rd party (social)
502 account authentication.")
503 (license license:expat)))
504
505 (define-public python-django-debug-toolbar
506 (package
507 (name "python-django-debug-toolbar")
508 (version "3.2.1")
509 (source
510 (origin
511 (method git-fetch)
512 (uri (git-reference
513 (url "https://github.com/jazzband/django-debug-toolbar")
514 (commit version)))
515 (file-name (git-file-name name version))
516 (sha256
517 (base32
518 "1m1j2sx7q0blma0miswj3c8hrfi5q4y5cq2b816v8gagy89xgc57"))))
519 (build-system python-build-system)
520 (propagated-inputs
521 `(("python-sqlparse" ,python-sqlparse)
522 ("python-django" ,python-django)))
523 (native-inputs
524 `(("python-django-jinja" ,python-django-jinja)
525 ("python-html5lib" ,python-html5lib)))
526 (arguments
527 '(#:phases
528 (modify-phases %standard-phases
529 (replace 'check
530 (lambda _
531 (invoke "make" "test"))))))
532 (home-page
533 "https://github.com/jazzband/django-debug-toolbar")
534 (synopsis "Toolbar to help with developing Django applications")
535 (description
536 "A configurable set of panels that display information about the current
537 request and response as a toolbar on the rendered page.")
538 (license license:bsd-3)))
539
540 (define-public python-django-debug-toolbar-alchemy
541 (package
542 (name "python-django-debug-toolbar-alchemy")
543 (version "0.1.5")
544 (home-page "https://github.com/miki725/django-debug-toolbar-alchemy")
545 (source (origin
546 (method url-fetch)
547 (uri (pypi-uri "django-debug-toolbar-alchemy" version))
548 (sha256
549 (base32
550 "1kmpzghnsc247bc1dl22s4y62k9ijgy1pjms227018h5a4frsa5b"))))
551 (build-system python-build-system)
552 (arguments '(#:tests? #f)) ;XXX: 'make check' does "echo TODO"
553 (propagated-inputs
554 `(("python-django" ,python-django)
555 ("python-django-debug-toolbar" ,python-django-debug-toolbar)
556 ("python-jsonplus" ,python-jsonplus)
557 ("python-six" ,python-six)
558 ("python-sqlalchemy" ,python-sqlalchemy)))
559 (synopsis "Django Debug Toolbar panel for SQLAlchemy")
560 (description
561 "This package completely mimics the default Django Debug Toolbar SQL
562 panel (internally it is actually subclassed), but instead of displaying
563 queries done via the Django ORM, SQLAlchemy generated queries are displayed.")
564 (license license:expat)))
565
566 (define-public python-django-gravatar2
567 (package
568 (name "python-django-gravatar2")
569 (version "1.4.4")
570 (source
571 (origin
572 (method url-fetch)
573 (uri (pypi-uri "django-gravatar2" version))
574 (sha256
575 (base32
576 "1vn921fb6jjx7rf5dzhy66rkb71nwmh9ydd0xs9ys72icw4jh4y8"))))
577 (build-system python-build-system)
578 (arguments
579 '(;; TODO: The django project for the tests is missing from the release.
580 #:tests? #f))
581 (inputs
582 `(("python-django" ,python-django)))
583 (home-page "https://github.com/twaddington/django-gravatar")
584 (synopsis "Gravatar support for Django, improved version")
585 (description
586 "Essential Gravatar support for Django. Features helper methods,
587 templatetags and a full test suite.")
588 (license license:expat)))
589
590 (define-public python-django-assets
591 (package
592 (name "python-django-assets")
593 (version "2.0")
594 (source (origin
595 (method url-fetch)
596 (uri (pypi-uri "django-assets" version))
597 (sha256
598 (base32
599 "0fc6i77faxxv1gjlp06lv3kw64b5bhdiypaygfxh5djddgk83fwa"))))
600 (build-system python-build-system)
601 (native-inputs
602 `(("python-nose" ,python-nose)))
603 (propagated-inputs
604 `(("python-django" ,python-django)
605 ("python-webassets" ,python-webassets)))
606 (home-page "https://github.com/miracle2k/django-assets")
607 (synopsis "Asset management for Django")
608 (description
609 "Asset management for Django, to compress and merge CSS and Javascript
610 files. Integrates the webassets library with Django, adding support for
611 merging, minifying and compiling CSS and Javascript files.")
612 (license license:bsd-2)))
613
614 (define-public python-django-jinja
615 (package
616 (name "python-django-jinja")
617 (version "2.9.1")
618 (source
619 (origin
620 (method git-fetch)
621 (uri (git-reference
622 (url "https://github.com/niwinz/django-jinja")
623 (commit version)))
624 (file-name (git-file-name name version))
625 (sha256
626 (base32
627 "0p9pkn6jjzagpnvcrl9c2vjqamkms7ymvyhhmaqqqhrlv89qnzp7"))))
628 (build-system python-build-system)
629 (propagated-inputs
630 `(("python-django" ,python-django)
631 ("python-jinja2" ,python-jinja2)
632 ("python-pytz" ,python-pytz)
633 ("python-django-pipeline" ,python-django-pipeline)))
634 (arguments
635 '(;; TODO Tests currently fail due to issues with the configuration for
636 ;; django-pipeline
637 #:tests? #f
638 #:phases
639 (modify-phases %standard-phases
640 (replace 'check
641 (lambda* (#:key tests? #:allow-other-keys)
642 (or
643 (not tests?)
644 (with-directory-excursion "testing"
645 (invoke "python" "runtests.py"))))))))
646 (home-page
647 "https://niwinz.github.io/django-jinja/latest/")
648 (synopsis "Simple jinja2 templating backend for Django")
649 (description
650 "This package provides a templating backend for Django, using Jinja2. It
651 provides certain advantages over the builtin Jinja2 backend in Django, for
652 example, explicit calls to callables from templates and better performance.")
653 (license license:bsd-3)))
654
655 (define-public python-dj-database-url
656 (package
657 (name "python-dj-database-url")
658 (version "0.5.0")
659 (source (origin
660 (method url-fetch)
661 (uri (pypi-uri "dj-database-url" version))
662 (sha256
663 (base32
664 "0qs16g5y3lflxibsl8gwkwap21crhmmv98l60rdq6x1wawgypsja"))))
665 (build-system python-build-system)
666 (home-page "https://github.com/kennethreitz/dj-database-url")
667 (synopsis "Use Database URLs in your Django Application")
668 (description
669 "This simple Django utility allows you to utilize the 12factor inspired
670 DATABASE_URL environment variable to configure your Django application.
671
672 The dj_database_url.config method returns a Django database connection
673 dictionary, populated with all the data specified in your URL. There is also a
674 conn_max_age argument to easily enable Django’s connection pool.")
675 (license license:bsd-2)))
676
677 (define-public python-django-picklefield
678 (package
679 (name "python-django-picklefield")
680 (version "3.0.1")
681 (home-page "https://github.com/gintas/django-picklefield")
682 ;; Use a git checkout because the PyPI release lacks tests.
683 (source
684 (origin
685 (method git-fetch)
686 (uri (git-reference
687 (url home-page)
688 (commit (string-append "v" version))))
689 (file-name (git-file-name name version))
690 (sha256
691 (base32
692 "0ni7bc86k0ra4pc8zv451pzlpkhs1nyil1sq9jdb4m2mib87b5fk"))))
693 (build-system python-build-system)
694 (arguments
695 '(#:phases (modify-phases %standard-phases
696 (replace 'check
697 (lambda _
698 (invoke "python" "-m" "django" "test" "-v2"
699 "--settings=tests.settings"))))))
700 (propagated-inputs
701 ;; XXX: Picklefield has not been updated in 10+ years and fails tests
702 ;; with Django 3.2.
703 `(("python-django@2.2" ,python-django-2.2)))
704 (synopsis "Pickled object field for Django")
705 (description "Pickled object field for Django")
706 (license license:expat)))
707
708 (define-public python-django-bulk-update
709 (package
710 (name "python-django-bulk-update")
711 (version "2.2.0")
712 (source (origin
713 (method url-fetch)
714 (uri (pypi-uri "django-bulk-update" version))
715 (sha256
716 (base32
717 "0dxkmrm3skyw82i0qa8vklxw1ma1y308kh9w2hcnvhpacn5cxdss"))))
718 (build-system python-build-system)
719 (arguments
720 ;; XXX: Tests require a Postgres database.
721 `(#:tests? #f))
722 (propagated-inputs
723 `(("python-django" ,python-django)))
724 (home-page "https://github.com/aykut/django-bulk-update")
725 (synopsis "Simple bulk update over Django ORM or with helper function")
726 (description
727 "Simple bulk update over Django ORM or with helper function. This
728 project aims to bulk update given objects using one query over Django ORM.")
729 (license license:expat)))
730
731 (define-public python-django-contact-form
732 (package
733 (name "python-django-contact-form")
734 (version "1.9")
735 (source (origin
736 (method url-fetch)
737 (uri (pypi-uri "django-contact-form" version))
738 (sha256
739 (base32
740 "1my9hkrylckp5vfqg9b0kncrdlxjnwxll56sdciqn4v19i4wbq1y"))))
741 (build-system python-build-system)
742 (arguments
743 `(#:phases
744 (modify-phases %standard-phases
745 (replace 'check
746 (lambda _
747 (invoke "coverage" "run" "--source" "contact_form"
748 "runtests.py"))))))
749 (native-inputs
750 `(("python-coverage" ,python-coverage)))
751 (propagated-inputs
752 `(("python-django" ,python-django)))
753 (home-page "https://github.com/ubernostrum/django-contact-form")
754 (synopsis "Contact form for Django")
755 (description
756 "This application provides simple, extensible contact-form functionality
757 for Django sites.")
758 (license license:bsd-3)))
759
760 (define-public python-django-contrib-comments
761 (package
762 (name "python-django-contrib-comments")
763 (version "1.9.2")
764 (source (origin
765 (method url-fetch)
766 (uri (pypi-uri "django-contrib-comments" version))
767 (sha256
768 (base32
769 "0ccdiv784a5vnpfal36km4dyg12340rwhpr0riyy0k89wfnjn8yi"))))
770 (build-system python-build-system)
771 (propagated-inputs
772 `(("python-django" ,python-django)
773 ("python-six" ,python-six)))
774 (home-page "https://github.com/django/django-contrib-comments")
775 (synopsis "Comments framework")
776 (description
777 "Django used to include a comments framework; since Django 1.6 it's been
778 separated to a separate project. This is that project. This framework can be
779 used to attach comments to any model, so you can use it for comments on blog
780 entries, photos, book chapters, or anything else.")
781 (license license:bsd-3)))
782
783 (define-public python-django-pipeline
784 (package
785 (name "python-django-pipeline")
786 (version "2.0.5")
787 (source
788 (origin
789 (method url-fetch)
790 (uri (pypi-uri "django-pipeline" version))
791 (sha256
792 (base32
793 "19vrbd5s12qw4qlg5n8ldv7zz2rs5y2sdid1i7lvgp92m71dayvc"))))
794 (build-system python-build-system)
795 (arguments
796 '(#:phases
797 (modify-phases %standard-phases
798 (add-after 'unpack 'patch-source
799 (lambda _
800 (substitute* "tests/tests/test_compiler.py"
801 (("\\/usr\\/bin\\/env")
802 (which "env")))))
803 (replace 'check
804 (lambda*(#:key tests? #:allow-other-keys)
805 (when tests?
806 (setenv "DJANGO_SETTINGS_MODULE" "tests.settings")
807 (invoke "django-admin" "test" "tests"
808 "--pythonpath=.")))))))
809 (propagated-inputs
810 `(("python-css-html-js-minify" ,python-css-html-js-minify)
811 ("python-django" ,python-django)
812 ("python-slimit" ,python-slimit)
813 ("python-jsmin" ,python-jsmin)))
814 (home-page
815 "https://github.com/jazzband/django-pipeline")
816 (synopsis "Asset packaging library for Django")
817 (description
818 "Pipeline is an asset packaging library for Django, providing both CSS
819 and JavaScript concatenation and compression, built-in JavaScript template
820 support, and optional data-URI image and font embedding.")
821 (license license:expat)))
822
823 (define-public python-django-redis
824 (package
825 (name "python-django-redis")
826 (version "4.12.1")
827 (source (origin
828 (method url-fetch)
829 (uri (pypi-uri "django-redis" version))
830 (sha256
831 (base32
832 "0qvsm8yjchl0d3i7g20wba6px9lb5gv8kp3fcnr6hr0y0b3qjr9h"))))
833 (build-system python-build-system)
834 (arguments
835 `(#:phases
836 (modify-phases %standard-phases
837 (replace 'check
838 (lambda _
839 (invoke "redis-server" "--daemonize" "yes")
840 (with-directory-excursion "tests"
841 (invoke "python" "runtests.py")))))))
842 (native-inputs
843 `(("python-fakeredis" ,python-fakeredis)
844 ("python-hiredis" ,python-hiredis)
845 ("python-mock" ,python-mock)
846 ("python-msgpack" ,python-msgpack)
847 ("redis" ,redis)))
848 (propagated-inputs
849 `(("python-django" ,python-django)
850 ("python-redis" ,python-redis)))
851 (home-page "https://github.com/niwibe/django-redis")
852 (synopsis "Full featured redis cache backend for Django")
853 (description
854 "Full featured redis cache backend for Django.")
855 (license license:bsd-3)))
856
857 (define-public python-django-rq
858 (package
859 (name "python-django-rq")
860 (version "2.3.2")
861 (source (origin
862 (method url-fetch)
863 (uri (pypi-uri "django-rq" version))
864 (sha256
865 (base32
866 "0lksnjn3q3f7y72bj2yr8870w28a5b6x0vjnd9nhpq2ah6xfz6pf"))))
867 (build-system python-build-system)
868 (arguments
869 `(#:phases
870 (modify-phases %standard-phases
871 (replace 'check
872 (lambda _
873 (invoke "redis-server" "--daemonize" "yes")
874 (invoke "django-admin.py" "test" "django_rq"
875 "--settings=django_rq.tests.settings"
876 "--pythonpath=."))))))
877 (native-inputs
878 `(("python-django-redis" ,python-django-redis)
879 ("python-mock" ,python-mock)
880 ("python-rq-scheduler" ,python-rq-scheduler)
881 ("redis" ,redis)))
882 (propagated-inputs
883 `(("python-django" ,python-django)
884 ("python-rq" ,python-rq)))
885 (home-page "https://github.com/ui/django-rq")
886 (synopsis "Django integration with RQ")
887 (description
888 "Django integration with RQ, a Redis based Python queuing library.
889 Django-RQ is a simple app that allows you to configure your queues in django's
890 settings.py and easily use them in your project.")
891 (license license:expat)))
892
893 (define-public python-django-q
894 (package
895 (name "python-django-q")
896 (version "1.3.4")
897 (source
898 (origin
899 (method url-fetch)
900 (uri (pypi-uri "django-q" version))
901 (sha256
902 (base32 "03z1pf6wlf47i7afr79a8fiiidfk1vq19yaqnv0m4qdny7f58gaj"))))
903 (build-system python-build-system)
904 ;; FIXME: Tests require disque, Redis, MongoDB, Docker.
905 (arguments '(#:tests? #f))
906 (propagated-inputs
907 `(("python-arrow" ,python-arrow)
908 ("python-blessed" ,python-blessed)
909 ("python-django" ,python-django)
910 ("python-django-picklefield" ,python-django-picklefield)))
911 (home-page "https://django-q.readthedocs.io/")
912 (synopsis "Multiprocessing distributed task queue for Django")
913 (description
914 "Django Q is a native Django task queue, scheduler and worker application
915 using Python multiprocessing.")
916 (license license:expat)))
917
918 (define-public python-django-sortedm2m
919 (package
920 (name "python-django-sortedm2m")
921 (version "3.0.2")
922 (source (origin
923 (method url-fetch)
924 (uri (pypi-uri "django-sortedm2m" version))
925 (sha256
926 (base32
927 "0z0yymmrr2l5cznqbzwziw624df0qsiflvbpqwrpan52nww3dk4a"))))
928 (build-system python-build-system)
929 (arguments
930 `(#:phases (modify-phases %standard-phases
931 (replace 'check
932 (lambda _
933 (invoke "django-admin"
934 "test" "--settings=test_project.settings"
935 "--pythonpath=."))))))
936 (propagated-inputs
937 `(("python-django" ,python-django)))
938 (home-page "https://github.com/jazzband/django-sortedm2m")
939 (synopsis "Drop-in replacement for django's own ManyToManyField")
940 (description
941 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
942 The provided SortedManyToManyField behaves like the original one but remembers
943 the order of added relations.")
944 (license license:bsd-3)))
945
946 (define-public python-django-appconf
947 (package
948 (name "python-django-appconf")
949 (version "1.0.4")
950 (source (origin
951 (method url-fetch)
952 (uri (pypi-uri "django-appconf" version))
953 (sha256
954 (base32
955 "101k8nkc7xlffpjdi2qbrp9pc4v8hzvmkzi12qp7vms39asxwn5y"))))
956 (build-system python-build-system)
957 (arguments
958 '(#:phases (modify-phases %standard-phases
959 (replace 'check
960 (lambda _
961 (setenv "DJANGO_SETTINGS_MODULE" "tests.test_settings")
962 (invoke "python" "django-admin.py" "test" "-v2"))))))
963 (propagated-inputs
964 `(("python-django" ,python-django)))
965 (home-page "https://github.com/django-compressor/django-appconf")
966 (synopsis "Handle configuration defaults of packaged Django apps")
967 (description
968 "This app precedes Django's own AppConfig classes that act as \"objects
969 [to] store metadata for an application\" inside Django's app loading mechanism.
970 In other words, they solve a related but different use case than
971 django-appconf and can't easily be used as a replacement. The similarity in
972 name is purely coincidental.")
973 (license license:bsd-3)))
974
975 (define-public python-django-statici18n
976 (package
977 (name "python-django-statici18n")
978 (version "2.1.0")
979 (home-page "https://github.com/zyegfryed/django-statici18n")
980 (source (origin
981 (method git-fetch)
982 (uri (git-reference
983 (url home-page)
984 (commit (string-append "v" version))))
985 (file-name (git-file-name name version))
986 (sha256
987 (base32
988 "0x0xvfqd40is2ks43d65awgqkx3wk10lvdim15scvbjhkh301b6v"))))
989 (build-system python-build-system)
990 (arguments
991 '(#:phases (modify-phases %standard-phases
992 (replace 'check
993 (lambda _
994 (setenv "PYTHONPATH" "./tests/test_project")
995 (setenv "DJANGO_SETTINGS_MODULE" "project.settings")
996 (invoke "pytest" "-vv"))))))
997 (native-inputs
998 `(("python-pytest" ,python-pytest)
999 ("python-pytest-django" ,python-pytest-django)))
1000 (propagated-inputs
1001 `(("python-django" ,python-django)
1002 ("django-appconf" ,python-django-appconf)))
1003 (synopsis "Generate JavaScript catalog to static files")
1004 (description
1005 "A Django app that provides helper for generating JavaScript catalog to
1006 static files.")
1007 (license license:bsd-3)))
1008
1009 (define-public python-django-tagging
1010 (package
1011 (name "python-django-tagging")
1012 (version "0.5.0")
1013 (source
1014 (origin
1015 (method url-fetch)
1016 (uri (pypi-uri "django-tagging" version))
1017 (sha256
1018 (base32
1019 "13afxx30chssclxzd9gqnvwm9qyrdpnlbs6iswdfa18phfj8zmi8"))))
1020 (build-system python-build-system)
1021 (arguments
1022 `(#:phases
1023 (modify-phases %standard-phases
1024 (replace 'check
1025 (lambda _
1026 (setenv "DJANGO_SETTINGS_MODULE" "tagging.tests.settings")
1027 (invoke "django-admin" "test" "--pythonpath=."))))))
1028 (inputs
1029 `(("python-django" ,python-django)))
1030 (home-page "https://github.com/Fantomas42/django-tagging")
1031 (synopsis "Generic tagging application for Django")
1032 (description "This package provides a generic tagging application for
1033 Django projects, which allows association of a number of tags with any
1034 @code{Model} instance and makes retrieval of tags simple.")
1035 (license license:bsd-3)))
1036
1037 (define-public python-djangorestframework
1038 (package
1039 (name "python-djangorestframework")
1040 (version "3.12.4")
1041 (source
1042 (origin
1043 (method git-fetch)
1044 (uri (git-reference
1045 (url "https://github.com/encode/django-rest-framework")
1046 (commit version)))
1047 (file-name (git-file-name name version))
1048 (sha256
1049 (base32
1050 "16n17dw35wqv47m8k8fixn0yywrvd6v4r573yr4nx6lbbiyi2cqn"))))
1051 (build-system python-build-system)
1052 (arguments
1053 '(#:phases
1054 (modify-phases %standard-phases
1055 (replace 'check
1056 (lambda* (#:key tests? #:allow-other-keys)
1057 ;; Add a fix from the master branch for compatibility with Django
1058 ;; 3.2: https://github.com/encode/django-rest-framework/pull/7911
1059 ;; Remove for versions > 3.12.4.
1060 (substitute* "tests/test_fields.py"
1061 (("class MockTimezone:")
1062 "class MockTimezone(pytz.BaseTzInfo):"))
1063 (if tests?
1064 (invoke "python" "runtests.py" "--nolint")
1065 (format #t "test suite not run~%")))))))
1066 (native-inputs
1067 `(("python-pytest" ,python-pytest)
1068 ("python-pytest-django" ,python-pytest-django)))
1069 (propagated-inputs
1070 `(("python-django" ,python-django)))
1071 (home-page "https://www.django-rest-framework.org")
1072 (synopsis "Toolkit for building Web APIs with Django")
1073 (description
1074 "The Django REST framework is for building Web APIs with Django. It
1075 provides features like a Web-browsable API and authentication policies.")
1076 (license license:bsd-2)))
1077
1078 (define-public python-django-sekizai
1079 (package
1080 (name "python-django-sekizai")
1081 (version "2.0.0")
1082 (source
1083 (origin
1084 (method url-fetch)
1085 (uri (pypi-uri "django-sekizai" version))
1086 (sha256
1087 (base32
1088 "0vrkli625b5s1wldri3dyrfvqbxg7zxy2pg0rpjixw3b1ndz0ag8"))))
1089 (build-system python-build-system)
1090 (arguments '(#:tests? #f)) ; Tests not included with release.
1091 (propagated-inputs
1092 `(("python-django" ,python-django)
1093 ("python-django-classy-tags" ,python-django-classy-tags)
1094 ("python-six" ,python-six)))
1095 (home-page "https://github.com/divio/django-sekizai")
1096 (synopsis "Template blocks for Django projects")
1097 (description "Sekizai means blocks in Japanese, and that is what this app
1098 provides. A fresh look at blocks. With @code{django-sekizai} you can define
1099 placeholders where your blocks get rendered and at different places in your
1100 templates append to those blocks. This is especially useful for css and
1101 javascript. Your subtemplates can now define css and javscript files to be
1102 included, and the css will be nicely put at the top and the javascript to the
1103 bottom, just like you should. Also sekizai will ignore any duplicate content in
1104 a single block.")
1105 (license license:bsd-3)))
1106
1107 (define-public python-django-crispy-forms
1108 (package
1109 (name "python-django-crispy-forms")
1110 (version "1.9.2")
1111 (source
1112 (origin
1113 (method url-fetch)
1114 (uri (pypi-uri "django-crispy-forms" version))
1115 (sha256
1116 (base32
1117 "0fxlf233f49hjax786p4r650rd0ilvhnpyvw8hv1d1aqnkxy1wgj"))))
1118 (build-system python-build-system)
1119 (arguments
1120 '(;; No included tests
1121 #:tests? #f))
1122 (propagated-inputs
1123 `(("python-django" ,python-django)))
1124 (home-page
1125 "http://github.com/maraujop/django-crispy-forms")
1126 (synopsis "Tool to control Django forms without custom templates")
1127 (description
1128 "@code{django-crispy-forms} lets you easily build, customize and reuse
1129 forms using your favorite CSS framework, without writing template code.")
1130 (license license:expat)))
1131
1132 (define-public python-django-compressor
1133 (package
1134 (name "python-django-compressor")
1135 (version "2.4.1")
1136 (source
1137 (origin
1138 (method url-fetch)
1139 (uri (pypi-uri "django_compressor" version))
1140 (sha256
1141 (base32 "1q0m0hfg7sqmj5km924g4dgy3nx51aszzsprlp6gsin10mv0fn1k"))))
1142 (build-system python-build-system)
1143 (arguments
1144 '(#:phases
1145 (modify-phases %standard-phases
1146 (replace 'check
1147 (lambda* (#:key tests? #:allow-other-keys)
1148 (if tests?
1149 (begin
1150 (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
1151 (invoke "django-admin" "test"
1152 "--pythonpath=."))
1153 #t))))
1154 ;; Tests fail with beautifulsoup 4.9+
1155 ;; https://github.com/django-compressor/django-compressor/issues/998
1156 #:tests? #f))
1157 (propagated-inputs
1158 `(("python-django-appconf" ,python-django-appconf)
1159 ("python-rcssmin" ,python-rcssmin)
1160 ("python-rjsmin" ,python-rjsmin)))
1161 (native-inputs
1162 `(("python-beautifulsoup4" ,python-beautifulsoup4)
1163 ("python-brotli" ,python-brotli)
1164 ("python-csscompressor" ,python-csscompressor)
1165 ("python-django-sekizai" ,python-django-sekizai)
1166 ("python-mock" ,python-mock)))
1167 (home-page "https://django-compressor.readthedocs.io/en/latest/")
1168 (synopsis
1169 "Compress linked and inline JavaScript or CSS into single cached files")
1170 (description
1171 "Django Compressor combines and compresses linked and inline Javascript or
1172 CSS in a Django templates into cacheable static files by using the compress
1173 template tag.")
1174 (license license:expat)))
1175
1176 (define-public python-django-override-storage
1177 (package
1178 (name "python-django-override-storage")
1179 (version "0.3.0")
1180 (home-page "https://github.com/danifus/django-override-storage")
1181 (source
1182 (origin
1183 (method git-fetch)
1184 (uri (git-reference
1185 (url home-page)
1186 (commit (string-append "v" version))))
1187 (file-name (git-file-name name version))
1188 (sha256
1189 (base32 "081kzfk7mmybhihvc92d3hsdg0r2k20ydq88fs1fgd348sq1ax51"))))
1190 (build-system python-build-system)
1191 (arguments
1192 '(#:phases (modify-phases %standard-phases
1193 (replace 'check
1194 (lambda _
1195 (invoke "python" "runtests.py"))))))
1196 (native-inputs
1197 `(("python-mock" ,python-mock)))
1198 (propagated-inputs
1199 `(("python-django" ,python-django)))
1200 (synopsis "Django test helpers to manage file storage side effects")
1201 (description
1202 "This project provides tools to help reduce the side effects of using
1203 FileFields during tests.")
1204 (license license:expat)))
1205
1206 (define-public python-django-auth-ldap
1207 (package
1208 (name "python-django-auth-ldap")
1209 (version "2.4.0")
1210 (source (origin
1211 (method url-fetch)
1212 (uri (pypi-uri "django-auth-ldap" version))
1213 (sha256
1214 (base32
1215 "0xk6cxiqz5j3q79bd54x64f26alrlc8p7k9wkp2c768w2k1vzz30"))))
1216 (build-system python-build-system)
1217 (arguments
1218 '(#:phases (modify-phases %standard-phases
1219 (replace 'check
1220 (lambda* (#:key inputs #:allow-other-keys)
1221 (let ((openldap (assoc-ref inputs "openldap")))
1222 ;; The tests need 'slapd' which is installed to the
1223 ;; libexec directory of OpenLDAP.
1224 (setenv "SLAPD" (string-append openldap "/libexec/slapd"))
1225 (setenv "SCHEMA"
1226 (string-append openldap "/etc/openldap/schema"))
1227 (invoke "python" "-m" "django" "test"
1228 "--settings" "tests.settings")))))))
1229 (native-inputs
1230 `(("openldap" ,openldap)
1231 ("python-mock" ,python-mock)))
1232 (propagated-inputs
1233 `(("python-django" ,python-django)
1234 ("python-ldap" ,python-ldap)))
1235 (home-page "https://github.com/django-auth-ldap/django-auth-ldap")
1236 (synopsis "Django LDAP authentication backend")
1237 (description
1238 "This package provides an LDAP authentication backend for Django.")
1239 (license license:bsd-2)))
1240
1241 (define-public python-django-logging-json
1242 (package
1243 (name "python-django-logging-json")
1244 (version "1.15")
1245 (source (origin
1246 (method url-fetch)
1247 (uri (pypi-uri "django-logging-json" version))
1248 (sha256
1249 (base32
1250 "06041a8icazzp73kg93c7k1ska12wvkq7fpcad0l0sm1qnxx5yx7"))))
1251 (build-system python-build-system)
1252 (arguments '(#:tests? #f)) ;no tests
1253 (propagated-inputs
1254 `(("python-certifi" ,python-certifi)
1255 ("python-django" ,python-django)
1256 ("python-elasticsearch" ,python-elasticsearch)
1257 ("python-six" ,python-six)))
1258 (home-page "https://github.com/cipriantarta/django-logging")
1259 (synopsis "Log requests/responses in various formats")
1260 (description
1261 "This package provides a Django library that logs request, response,
1262 and exception details in a JSON document. It can also send logs directly
1263 to ElasticSearch.")
1264 (license license:bsd-2)))
1265
1266 (define-public python-django-netfields
1267 (package
1268 (name "python-django-netfields")
1269 (version "1.2.2")
1270 (source (origin
1271 (method url-fetch)
1272 (uri (pypi-uri "django-netfields" version))
1273 (sha256
1274 (base32
1275 "1c47azr5am0q8g45x0fbn0cay7vyrack6n7k6siliw1j2p0gzi7s"))))
1276 (build-system python-build-system)
1277 (arguments '(#:tests? #f)) ;XXX: Requires a running PostgreSQL server
1278 (propagated-inputs
1279 `(("python-django" ,python-django)
1280 ("python-netaddr" ,python-netaddr)
1281 ("python-six" ,python-six)))
1282 (home-page "https://github.com/jimfunk/django-postgresql-netfields")
1283 (synopsis "PostgreSQL netfields implementation for Django")
1284 (description
1285 "This package provides mappings for the PostgreSQL @code{INET} and
1286 @code{CIDR} fields for use in Django projects.")
1287 (license license:bsd-3)))
1288
1289 (define-public python-django-url-filter
1290 (package
1291 (name "python-django-url-filter")
1292 (version "0.3.15")
1293 (home-page "https://github.com/miki725/django-url-filter")
1294 (source (origin
1295 (method git-fetch)
1296 (uri (git-reference (url home-page) (commit version)))
1297 (file-name (git-file-name name version))
1298 (sha256
1299 (base32
1300 "0r4zhqhs8y6cnplwyvcb0zpijizw1ifnszs38n4w8138657f9026"))))
1301 (build-system python-build-system)
1302 (arguments
1303 '(#:tests? #f ;FIXME: Django raises "Apps aren't loaded yet"!?
1304 #:phases (modify-phases %standard-phases
1305 (add-before 'check 'loosen-requirements
1306 (lambda _
1307 ;; Do not depend on compatibility package for old
1308 ;; Python versions.
1309 (substitute* "requirements.txt"
1310 (("enum-compat") ""))))
1311 (replace 'check
1312 (lambda* (#:key tests? #:allow-other-keys)
1313 (if tests?
1314 (begin
1315 (setenv "DJANGO_SETTINGS_MODULE"
1316 "test_project.settings")
1317 (invoke "pytest" "-vv" "--doctest-modules"
1318 "tests/" "url_filter/"))
1319 (format #t "test suite not run~%")))))))
1320 (propagated-inputs
1321 `(("python-cached-property" ,python-cached-property)
1322 ("python-django" ,python-django)
1323 ("python-six" ,python-six)))
1324 (synopsis "Filter data via human-friendly URLs")
1325 (description
1326 "The main goal of Django URL Filter is to provide an easy URL interface
1327 for filtering data. It allows the user to safely filter by model attributes
1328 and also specify the lookup type for each filter (very much like
1329 Django's filtering system in ORM).")
1330 (license license:expat)))