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