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