gnu: python-pytest-django: Update to 3.10.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 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 python)
38 #:use-module (gnu packages python-compression)
39 #:use-module (gnu packages python-crypto)
40 #:use-module (gnu packages python-web)
41 #:use-module (gnu packages python-xyz)
42 #:use-module (gnu packages sphinx)
43 #:use-module (gnu packages time)
44 #:use-module (gnu packages xml))
45
46 (define-public python-django
47 (package
48 (name "python-django")
49 (version "3.1.1")
50 (source (origin
51 (method url-fetch)
52 (uri (pypi-uri "Django" version))
53 (sha256
54 (base32
55 "0bzwy58hrxbsh7szak1yfh7qvvfnpdpi8ay1x7d3pvbkm1f15j2r"))))
56 (build-system python-build-system)
57 (arguments
58 '(#:phases
59 (modify-phases %standard-phases
60 (add-before 'check 'pre-check
61 (lambda* (#:key inputs #:allow-other-keys)
62 ;; The test-suite tests timezone-dependent functions, thus tzdata
63 ;; needs to be available.
64 (setenv "TZDIR"
65 (string-append (assoc-ref inputs "tzdata")
66 "/share/zoneinfo"))
67
68 ;; Disable test for incorrect timezone: it only raises the
69 ;; expected error when /usr/share/zoneinfo exists, even though
70 ;; the machinery gracefully falls back to TZDIR. According to
71 ;; django/conf/__init__.py, lack of /usr/share/zoneinfo is
72 ;; harmless, so just ignore this test.
73 (substitute* "tests/settings_tests/tests.py"
74 ((".*def test_incorrect_timezone.*" all)
75 (string-append " @unittest.skipIf(True, 'Disabled by Guix')\n"
76 all)))
77
78 ;; Preserve the PYTHONPATH created by Guix when running the tests.
79 (substitute* "tests/admin_scripts/tests.py"
80 (("python_path = \\[")
81 (string-append "python_path = ['"
82 (string-join
83 (string-split (getenv "PYTHONPATH") #\:)
84 "','")
85 "', ")))
86
87 #t))
88 (replace 'check
89 (lambda _
90 (with-directory-excursion "tests"
91 (setenv "PYTHONPATH"
92 (string-append "..:" (getenv "PYTHONPATH")))
93 (invoke "python" "runtests.py"
94 ;; By default tests run in parallel, which may cause
95 ;; various race conditions. Run sequentially for
96 ;; consistent results.
97 "--parallel=1")))))))
98 ;; TODO: Install extras/django_bash_completion.
99 (native-inputs
100 `(("tzdata" ,tzdata-for-tests)
101 ;; Remaining packages are test requirements taken from
102 ;; tests/requirements/py3.txt
103 ("python-docutils" ,python-docutils)
104 ;; optional for tests: ("python-geoip2" ,python-geoip2)
105 ("python-jinja2" ,python-jinja2) ; >= 2.7
106 ;; optional for tests: ("python-memcached" ,python-memcached)
107 ("python-numpy" ,python-numpy)
108 ("python-pillow" ,python-pillow)
109 ("python-pyyaml" ,python-pyyaml)
110 ;; optional for tests: ("python-selenium" ,python-selenium)
111 ("python-tblib" ,python-tblib)))
112 (propagated-inputs
113 `(("python-argon2-cffi" ,python-argon2-cffi)
114 ("python-asgiref" ,python-asgiref)
115 ("python-bcrypt" ,python-bcrypt)
116 ("python-pytz" ,python-pytz)
117
118 ;; This input is not strictly required, but in practice many Django
119 ;; libraries need it for test suites and similar.
120 ("python-sqlparse" ,python-sqlparse)))
121 (home-page "https://www.djangoproject.com/")
122 (synopsis "High-level Python Web framework")
123 (description
124 "Django is a high-level Python Web framework that encourages rapid
125 development and clean, pragmatic design. It provides many tools for building
126 any Web site. Django focuses on automating as much as possible and adhering
127 to the @dfn{don't repeat yourself} (DRY) principle.")
128 (license license:bsd-3)
129 (properties `((python2-variant . ,(delay python2-django))
130 (cpe-name . "django")))))
131
132 (define-public python2-django
133 (let ((base (package-with-python2 (strip-python2-variant python-django))))
134 (package
135 (inherit base)
136 (native-inputs
137 `(;; Test requirements for Python 2 taken from
138 ;; tests/requirements/py3.txt: enum34 and mock.
139 ("python2-enum34" ,python2-enum34)
140 ("python2-mock" ,python2-mock)
141 ;; When adding memcached mind: for Python 2 memcached <= 1.53 is
142 ;; required.
143 ,@(package-native-inputs base))))))
144
145 (define-public python-django-2.2
146 (package
147 (inherit python-django)
148 (version "2.2.16")
149 (source (origin
150 (method url-fetch)
151 (uri (pypi-uri "Django" version))
152 (sha256
153 (base32
154 "1535g2r322cl4x52fb0dmzlbg23539j2wx6027j54p22xvjlbkv2"))))
155 (native-inputs
156 `(;; XXX: In 2.2 and 3.0, selenium is required for the test suite.
157 ("python-selenium" ,python-selenium)
158 ,@(package-native-inputs python-django)))))
159
160 (define-public python-django-extensions
161 (package
162 (name "python-django-extensions")
163 (version "2.1.6")
164 (source
165 (origin
166 (method git-fetch)
167 ;; Fetch from the git repository, so that the tests can be run.
168 (uri (git-reference
169 (url "https://github.com/django-extensions/django-extensions")
170 (commit version)))
171 (file-name (string-append name "-" version))
172 (sha256
173 (base32
174 "0p4qrdinrv6indczlc8dcnm528i5fzmcn9xk1ja7ycfkyk5x6j5w"))))
175 (build-system python-build-system)
176 (arguments
177 '(#:tests? #f)) ;TODO collected 378 items / 3 errors / 1 skipped
178 (propagated-inputs
179 `(("python-six" ,python-six)
180 ("python-vobject" ,python-vobject)
181 ("python-werkzeug" ,python-werkzeug)
182 ("python-dateutil" ,python-dateutil)
183 ("python-django" ,python-django)))
184 (native-inputs
185 `(("python-mock" ,python-mock)
186 ("python-factory-boy" ,python-factory-boy)
187 ("python-tox" ,python-tox)
188 ("python-pytest" ,python-pytest)
189 ("python-pytest-cov" ,python-pytest-cov)
190 ("python-pytest-django" ,python-pytest-django)
191 ("python-shortuuid" , python-shortuuid)))
192 (home-page
193 "https://github.com/django-extensions/django-extensions")
194 (synopsis "Custom management extensions for Django")
195 (description
196 "Django-extensions extends Django providing, for example, management
197 commands, additional database fields and admin extensions.")
198 (license license:expat)))
199
200 (define-public python-django-simple-math-captcha
201 (package
202 (name "python-django-simple-math-captcha")
203 (version "1.0.7")
204 (source (origin
205 (method url-fetch)
206 (uri (pypi-uri "django-simple-math-captcha" version))
207 (sha256
208 (base32
209 "0906hms6y6znjhpd0g4wmzv9vcla4brkdpsm4zha9zdj8g5vq2hd"))))
210 (build-system python-build-system)
211 (arguments
212 ;; FIXME: Upstream uses a 'runtests.py' script that is not
213 ;; present in the pypi tarball.
214 '(#:tests? #f))
215 (propagated-inputs
216 `(("python-django" ,python-django)))
217 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
218 (synopsis "Easy-to-use math field/widget captcha for Django forms")
219 (description
220 "A multi-value-field that presents a human answerable question,
221 with no settings.py configuration necessary, but instead can be configured
222 with arguments to the field constructor.")
223 (license license:asl2.0)))
224
225 (define-public python2-django-simple-math-captcha
226 (package-with-python2 python-django-simple-math-captcha))
227
228 (define-public python-django-classy-tags
229 (package
230 (name "python-django-classy-tags")
231 (version "1.0.0")
232 (source
233 (origin
234 (method url-fetch)
235 (uri (pypi-uri "django-classy-tags" version))
236 (sha256
237 (base32
238 "1cayqddvxd5prhybqi77lif2z4j7mmfmxgc61pq9i82q5gy2asmd"))))
239 (build-system python-build-system)
240 (arguments '(#:tests? #f)) ; Test script not distributed with release.
241 (propagated-inputs
242 `(("python-django" ,python-django)
243 ("python-six" ,python-six)))
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.1.0")
257 (source
258 (origin
259 (method url-fetch)
260 (uri (pypi-uri "django-taggit" version))
261 (sha256
262 (base32
263 "044fzcpmns90kaxdi49qczlam4xsi8rl73rpfwvxx1gkcqzidgq1"))))
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 python2-pytest-django
358 (package-with-python2 python-pytest-django))
359
360 (define-public python-django-haystack
361 (package
362 (name "python-django-haystack")
363 (version "2.8.1")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (pypi-uri "django-haystack" version))
368 (sha256
369 (base32
370 "1302fqsrx8w474xk5cmnmg3hjqfprlxnjg9qlg86arsr4v4vqm4b"))))
371 (build-system python-build-system)
372 (arguments
373 '(#:phases
374 (modify-phases %standard-phases
375 (add-after 'unpack 'loosen-verion-restrictions
376 (lambda _
377 (substitute* "setup.py"
378 (("geopy.*") "geopy',\n"))
379 #t))
380 (add-before 'check 'set-gdal-lib-path
381 (lambda* (#:key inputs #:allow-other-keys)
382 (setenv "GDAL_LIBRARY_PATH"
383 (string-append (assoc-ref inputs "gdal")
384 "/lib"))
385 #t)))
386 #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file
387 (propagated-inputs
388 `(("python-django" ,python-django)))
389 (native-inputs
390 `(("gdal" ,gdal)
391 ("python-coverage" ,python-coverage)
392 ("python-dateutil" ,python-dateutil)
393 ("python-geopy" ,python-geopy)
394 ("python-mock" ,python-mock)
395 ("python-nose" ,python-nose)
396 ("python-requests" ,python-requests)
397 ("python-setuptools-scm" ,python-setuptools-scm)
398 ("python-pysolr" ,python-pysolr)
399 ("python-whoosh" ,python-whoosh)))
400 (home-page "http://haystacksearch.org/")
401 (synopsis "Pluggable search for Django")
402 (description "Haystack provides modular search for Django. It features a
403 unified, familiar API that allows you to plug in different search backends
404 (such as Solr, Elasticsearch, Whoosh, Xapian, etc.) without having to modify
405 your code.")
406 (license license:bsd-3)))
407
408 (define-public python-django-filter
409 (package
410 (name "python-django-filter")
411 (version "1.1.0")
412 (source (origin
413 (method url-fetch)
414 (uri (pypi-uri "django-filter" version))
415 (sha256
416 (base32
417 "0slpfqfhnjrzlrb6vmswyhrzn01p84s16j2x1xib35gg4fxg23pc"))))
418 (build-system python-build-system)
419 (arguments
420 '(#:phases
421 (modify-phases %standard-phases
422 (replace 'check
423 (lambda _
424 (invoke "python" "runtests.py"))))))
425 (native-inputs
426 `(("python-django" ,python-django)
427 ("python-djangorestframework" ,python-djangorestframework)
428 ("python-django-crispy-forms" ,python-django-crispy-forms)
429 ("python-mock" ,python-mock)))
430 (home-page "https://django-filter.readthedocs.io/en/latest/")
431 (synopsis "Reusable Django application to filter querysets dynamically")
432 (description
433 "Django-filter is a generic, reusable application to alleviate writing
434 some of the more mundane bits of view code. Specifically, it allows users to
435 filter down a queryset based on a model’s fields, displaying the form to let
436 them do this.")
437 (license license:bsd-3)))
438
439 (define-public python2-django-filter
440 (package-with-python2 python-django-filter))
441
442 (define-public python-django-allauth
443 (package
444 (name "python-django-allauth")
445 (version "0.40.0")
446 (source
447 (origin
448 (method url-fetch)
449 (uri (pypi-uri "django-allauth" version))
450 (sha256
451 (base32
452 "12f5gjidcpb7a0d1f601k0c5dcdmb6fg9sfn7xn5j8zfsg29y63a"))))
453 (build-system python-build-system)
454 (arguments
455 '(#:phases
456 (modify-phases %standard-phases
457 (replace 'check
458 (lambda _
459 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
460 (invoke "django-admin" "test" "allauth.tests"
461 "--pythonpath=."))))))
462 (propagated-inputs
463 `(("python-openid" ,python-openid)
464 ("python-requests" ,python-requests)
465 ("python-requests-oauthlib" ,python-requests-oauthlib)))
466 (native-inputs
467 `(("python-mock" ,python-mock)))
468 (inputs
469 `(("python-django" ,python-django)))
470 (home-page "https://github.com/pennersr/django-allauth")
471 (synopsis "Set of Django applications addressing authentication")
472 (description
473 "Integrated set of Django applications addressing authentication,
474 registration, account management as well as 3rd party (social)
475 account authentication.")
476 (license license:expat)))
477
478 (define-public python2-django-allauth
479 (package-with-python2 python-django-allauth))
480
481 (define-public python-django-debug-toolbar
482 (package
483 (name "python-django-debug-toolbar")
484 (version "1.10.1")
485 (source
486 (origin
487 (method git-fetch)
488 (uri (git-reference
489 (url "https://github.com/jazzband/django-debug-toolbar")
490 (commit version)))
491 (file-name (git-file-name name version))
492 (sha256
493 (base32
494 "0zr6yjsms97wlvvd17rdbrx01irkg887dn9x70c1hzfjmfvp9afk"))))
495 (build-system python-build-system)
496 (propagated-inputs
497 `(("python-sqlparse" ,python-sqlparse)
498 ("python-django" ,python-django)))
499 (native-inputs
500 `(("python-django-jinja" ,python-django-jinja)
501 ("python-html5lib" ,python-html5lib)))
502 (arguments
503 '(#:phases
504 (modify-phases %standard-phases
505 (replace 'check
506 (lambda _
507 (invoke "make" "test"))))))
508 (home-page
509 "https://github.com/jazzband/django-debug-toolbar")
510 (synopsis "Toolbar to help with developing Django applications")
511 (description
512 "A configurable set of panels that display information about the current
513 request and response as a toolbar on the rendered page.")
514 (license license:bsd-3)))
515
516 (define-public python-django-gravatar2
517 (package
518 (name "python-django-gravatar2")
519 (version "1.4.2")
520 (source
521 (origin
522 (method url-fetch)
523 (uri (pypi-uri "django-gravatar2" version))
524 (sha256
525 (base32
526 "1qsv40xywbqsf4mkrmsswrpzqd7nfljxpfiim9an2z3dykn5rka6"))))
527 (build-system python-build-system)
528 (arguments
529 '(;; TODO: The django project for the tests is missing from the release.
530 #:tests? #f))
531 (inputs
532 `(("python-django" ,python-django)))
533 (home-page "https://github.com/twaddington/django-gravatar")
534 (synopsis "Gravatar support for Django, improved version")
535 (description
536 "Essential Gravatar support for Django. Features helper methods,
537 templatetags and a full test suite.")
538 (license license:expat)))
539
540 (define-public python2-django-gravatar2
541 (package-with-python2 python-django-gravatar2))
542
543 (define-public python-django-assets
544 (package
545 (name "python-django-assets")
546 (version "0.12")
547 (source (origin
548 (method url-fetch)
549 (uri (pypi-uri "django-assets" version))
550 (sha256
551 (base32
552 "0y0007fvkn1rdlj2g0y6k1cnkx53kxab3g8i85i0rd58k335p365"))))
553 (build-system python-build-system)
554 (arguments
555 `(#:phases
556 (modify-phases %standard-phases
557 (add-before 'check 'fix-tests
558 (lambda _
559 (begin
560 ;; https://github.com/miracle2k/django-assets/issues/87
561 (substitute* "tests/__init__.py"
562 (("settings.configure.*")
563 (string-append
564 "settings.configure(\n"
565 "INSTALLED_APPS=['django_assets', "
566 "'django.contrib.staticfiles'],\n"
567 "TEMPLATES=[{'BACKEND': "
568 "'django.template.backends.django.DjangoTemplates'}],\n"
569 ")\n")))
570 ;; These tests fail
571 (substitute* "tests/test_django.py"
572 (("TestLoader") "NoTestLoader"))))))))
573 (native-inputs
574 `(("python-nose" ,python-nose)))
575 (propagated-inputs
576 `(("python-django" ,python-django)
577 ("python-webassets" ,python-webassets)))
578 (home-page "https://github.com/miracle2k/django-assets")
579 (synopsis "Asset management for Django")
580 (description
581 "Asset management for Django, to compress and merge CSS and Javascript
582 files. Integrates the webassets library with Django, adding support for
583 merging, minifying and compiling CSS and Javascript files.")
584 (license license:bsd-2)))
585
586 (define-public python2-django-assets
587 (package-with-python2 python-django-assets))
588
589 (define-public python-django-jinja
590 (package
591 (name "python-django-jinja")
592 (version "2.4.1")
593 (source
594 (origin
595 (method git-fetch)
596 (uri (git-reference
597 (url "https://github.com/niwinz/django-jinja")
598 (commit version)))
599 (file-name (git-file-name name version))
600 (sha256
601 (base32
602 "1fcrxlznlq1xvl26y3j1r22vvy6m08r5l97xi2wj50rdmxhfvhis"))))
603 (build-system python-build-system)
604 (propagated-inputs
605 `(("python-django" ,python-django)
606 ("python-jinja2" ,python-jinja2)
607 ("python-pytz" ,python-pytz)
608 ("python-django-pipeline" ,python-django-pipeline)))
609 (arguments
610 '(;; TODO Tests currently fail due to issues with the configuration for
611 ;; django-pipeline
612 #:tests? #f
613 #:phases
614 (modify-phases %standard-phases
615 (replace 'check
616 (lambda* (#:key tests? #:allow-other-keys)
617 (or
618 (not tests?)
619 (with-directory-excursion "testing"
620 (invoke "python" "runtests.py"))))))))
621 (home-page
622 "https://niwinz.github.io/django-jinja/latest/")
623 (synopsis "Simple jinja2 templating backend for Django")
624 (description
625 "This package provides a templating backend for Django, using Jinja2. It
626 provides certain advantages over the builtin Jinja2 backend in Django, for
627 example, explicit calls to callables from templates and better performance.")
628 (license license:bsd-3)))
629
630 (define-public python-django-jsonfield
631 (package
632 (name "python-django-jsonfield")
633 (version "1.0.3")
634 (source (origin
635 (method url-fetch)
636 (uri (pypi-uri "jsonfield" version))
637 (sha256
638 (base32
639 "19x4lak0hg9c20r7mvf27w7i8r6i4sg2g0ypmlmp2665fnk76zvy"))))
640 (build-system python-build-system)
641 (arguments
642 `(#:phases
643 (modify-phases %standard-phases
644 (add-before 'check 'fix-tests
645 (lambda _
646 (substitute* "jsonfield/tests.py"
647 (("django.forms.util") "django.forms.utils")))))))
648 (propagated-inputs
649 `(("python-django" ,python-django)))
650 (home-page "https://github.com/bradjasper/django-jsonfield")
651 (synopsis "Store validated JSON in your model")
652 (description
653 "Django-jsonfield is a reusable Django field that allows you to store
654 validated JSON in your model. It silently takes care of serialization. To
655 use, simply add the field to one of your models.")
656 (license license:expat)))
657
658 (define-public python2-django-jsonfield
659 (package-with-python2 python-django-jsonfield))
660
661 (define-public python-dj-database-url
662 (package
663 (name "python-dj-database-url")
664 (version "0.4.2")
665 (source (origin
666 (method url-fetch)
667 (uri (pypi-uri "dj-database-url" version))
668 (sha256
669 (base32
670 "024zbkc5rli4hia9lz9g8kf1zxhb2gwawj5abf67i7gf8n22v0x6"))))
671 (build-system python-build-system)
672 (home-page "https://github.com/kennethreitz/dj-database-url")
673 (synopsis "Use Database URLs in your Django Application")
674 (description
675 "This simple Django utility allows you to utilize the 12factor inspired
676 DATABASE_URL environment variable to configure your Django application.
677
678 The dj_database_url.config method returns a Django database connection
679 dictionary, populated with all the data specified in your URL. There is also a
680 conn_max_age argument to easily enable Django’s connection pool.")
681 (license license:bsd-2)))
682
683 (define-public python2-dj-database-url
684 (package-with-python2 python-dj-database-url))
685
686 (define-public python-django-picklefield
687 (package
688 (name "python-django-picklefield")
689 (version "2.1.1")
690 (source
691 (origin
692 (method url-fetch)
693 (uri (pypi-uri "django-picklefield" version))
694 (sha256
695 (base32
696 "0imncys5s3vsy2q79nn7k5d670da1xgmcr9gmhn06fry6ibf39b7"))))
697 (build-system python-build-system)
698 (propagated-inputs `(("python-django" ,python-django)))
699 (native-inputs `(("python-tox" ,python-tox)))
700 (home-page "https://github.com/gintas/django-picklefield")
701 (synopsis "Pickled object field for Django")
702 (description "Pickled object field for Django")
703 (license license:expat)))
704
705 (define-public python-django-bulk-update
706 (package
707 (name "python-django-bulk-update")
708 (version "1.1.10")
709 (source (origin
710 (method url-fetch)
711 (uri (pypi-uri "django-bulk-update" version))
712 (sha256
713 (base32
714 "0mbng9m7swfc0dnidipbzlxfhlfjrv755dlnha5s4m9mgdxb1fhc"))))
715 (build-system python-build-system)
716 (arguments
717 ;; tests don't support django 1.10, but the module seems to work.
718 `(#:tests? #f))
719 (native-inputs
720 `(("six" ,python-six)
721 ("jsonfield" ,python-django-jsonfield)
722 ("python-dj-database-url" ,python-dj-database-url)))
723 (propagated-inputs
724 `(("python-django" ,python-django)))
725 (home-page "https://github.com/aykut/django-bulk-update")
726 (synopsis "Simple bulk update over Django ORM or with helper function")
727 (description
728 "Simple bulk update over Django ORM or with helper function. This
729 project aims to bulk update given objects using one query over Django ORM.")
730 (license license:expat)))
731
732 (define-public python2-django-bulk-update
733 (package-with-python2 python-django-bulk-update))
734
735 (define-public python-django-contact-form
736 (package
737 (name "python-django-contact-form")
738 (version "1.3")
739 (source (origin
740 (method url-fetch)
741 (uri (pypi-uri "django-contact-form" version))
742 (sha256
743 (base32
744 "0az590y56k5ahv4sixrkn54d3a8ig2q2z9pl6s3m4f533mx2gj17"))))
745 (build-system python-build-system)
746 (arguments
747 `(#:phases
748 (modify-phases %standard-phases
749 (replace 'check
750 (lambda _
751 ;; the next version will need "make test"
752 (invoke "flake8" "contact_form")
753 (invoke "coverage" "run" "contact_form/runtests.py")
754 (invoke "coverage" "report" "-m" "--fail-under" "0"))))))
755 (native-inputs
756 `(("python-coverage" ,python-coverage)
757 ("python-flake8" ,python-flake8)))
758 (propagated-inputs
759 `(("python-django" ,python-django)))
760 (home-page "https://github.com/ubernostrum/django-contact-form")
761 (synopsis "Contact form for Django")
762 (description
763 "This application provides simple, extensible contact-form functionality
764 for Django sites.")
765 (license license:bsd-3)))
766
767 (define-public python2-django-contact-form
768 (package-with-python2 python-django-contact-form))
769
770 (define-public python-django-contrib-comments
771 (package
772 (name "python-django-contrib-comments")
773 (version "1.8.0")
774 (source (origin
775 (method url-fetch)
776 (uri (pypi-uri "django-contrib-comments" version))
777 (sha256
778 (base32
779 "0bxsgw8jrkhg6r5s0z6ksfi4w8yknaqb1s9acmxd9pm3pnsnp5kx"))))
780 (build-system python-build-system)
781 (propagated-inputs
782 `(("python-django" ,python-django)))
783 (home-page "https://github.com/django/django-contrib-comments")
784 (synopsis "Comments framework")
785 (description
786 "Django used to include a comments framework; since Django 1.6 it's been
787 separated to a separate project. This is that project. This framework can be
788 used to attach comments to any model, so you can use it for comments on blog
789 entries, photos, book chapters, or anything else.")
790 (license license:bsd-3)))
791
792 (define-public python2-django-contrib-comments
793 (package-with-python2 python-django-contrib-comments))
794
795 (define-public python-django-overextends
796 (package
797 (name "python-django-overextends")
798 (version "0.4.3")
799 (source (origin
800 (method url-fetch)
801 (uri (pypi-uri "django-overextends" version))
802 (sha256
803 (base32
804 "0qc2pcf3i56pmfxh2jw7k3pgljd8xzficmkl2541n7bkcbngqfzm"))))
805 (build-system python-build-system)
806 (arguments
807 `(#:phases
808 (modify-phases %standard-phases
809 (replace 'check
810 (lambda _ (invoke "./test_project/manage.py" "test"))))))
811 (propagated-inputs
812 `(("python-django" ,python-django)))
813 (native-inputs
814 `(("sphinx-me" ,python-sphinx-me)))
815 (home-page "https://github.com/stephenmcd/django-overextends")
816 (synopsis "Circular template inheritance")
817 (description
818 "A Django reusable app providing the overextends template tag, a drop-in
819 replacement for Django's extends tag, which allows you to use circular template
820 inheritance. The primary use-case for overextends is to simultaneously
821 override and extend templates from other reusable apps, in your own Django
822 project.")
823 (license license:bsd-2)))
824
825 (define-public python2-django-overextends
826 (package-with-python2 python-django-overextends))
827
828 (define-public python-django-pipeline
829 (package
830 (name "python-django-pipeline")
831 (version "1.6.14")
832 (source
833 (origin
834 (method url-fetch)
835 (uri (pypi-uri "django-pipeline" version))
836 (sha256
837 (base32
838 "1a207y71r7za033ira0qmh2yrgp5rq0l04gw2fg9b8jri7sslrzg"))))
839 (build-system python-build-system)
840 (arguments
841 '(#:phases
842 (modify-phases %standard-phases
843 (add-after 'unpack 'patch-source
844 (lambda _
845 (substitute* "tests/tests/test_compiler.py"
846 (("\\/usr\\/bin\\/env")
847 (which "env")))))
848 (replace 'check
849 (lambda*(#:key tests? #:allow-other-keys)
850 (or
851 (not tests?)
852 (begin
853 (setenv "PYTHONPATH"
854 (string-append (getcwd) ":"
855 (getenv "PYTHONPATH")))
856 (setenv "DJANGO_SETTINGS_MODULE" "tests.settings")
857 (invoke "django-admin" "test" "tests"))))))))
858 (propagated-inputs
859 `(("python-django" ,python-django)
860 ("python-slimit" ,python-slimit)
861 ("python-jsmin" ,python-jsmin)))
862 (home-page
863 "https://github.com/jazzband/django-pipeline")
864 (synopsis "Asset packaging library for Django")
865 (description
866 "Pipeline is an asset packaging library for Django, providing both CSS
867 and JavaScript concatenation and compression, built-in JavaScript template
868 support, and optional data-URI image and font embedding.")
869 (license license:expat)))
870
871 (define-public python-django-redis
872 (package
873 (name "python-django-redis")
874 (version "4.10.0")
875 (source (origin
876 (method url-fetch)
877 (uri (pypi-uri "django-redis" version))
878 (sha256
879 (base32
880 "1rxcwnv9ik0swkwvfqdi9i9baw6n8if5pj6q63fjh4p9chw3j2xg"))))
881 (build-system python-build-system)
882 (arguments
883 `(#:phases
884 (modify-phases %standard-phases
885 (replace 'check
886 (lambda _
887 (invoke "redis-server" "--daemonize" "yes")
888 (with-directory-excursion "tests"
889 (invoke "python" "runtests.py")))))))
890 (native-inputs
891 `(("python-fakeredis" ,python-fakeredis)
892 ("python-hiredis" ,python-hiredis)
893 ("python-mock" ,python-mock)
894 ("python-msgpack" ,python-msgpack)
895 ("redis" ,redis)))
896 (propagated-inputs
897 `(("python-django" ,python-django)
898 ("python-redis" ,python-redis)))
899 (home-page "https://github.com/niwibe/django-redis")
900 (synopsis "Full featured redis cache backend for Django")
901 (description
902 "Full featured redis cache backend for Django.")
903 (license license:bsd-3)))
904
905 (define-public python2-django-redis
906 (package-with-python2 python-django-redis))
907
908 (define-public python-django-rq
909 (package
910 (name "python-django-rq")
911 (version "1.3.1")
912 (source (origin
913 (method url-fetch)
914 (uri (pypi-uri "django-rq" version))
915 (sha256
916 (base32
917 "1ips1ikv5qhgwb58ssn496vgqg9qv6jinwmwbrg9l3s75fskd1l5"))))
918 (build-system python-build-system)
919 (arguments
920 `(#:phases
921 (modify-phases %standard-phases
922 (replace 'check
923 (lambda _
924 (invoke "redis-server" "--daemonize" "yes")
925 (invoke "django-admin.py" "test" "django_rq"
926 "--settings=django_rq.tests.settings"
927 "--pythonpath=."))))))
928 (native-inputs
929 `(("python-mock" ,python-mock)
930 ("redis" ,redis)))
931 (propagated-inputs
932 `(("python-django" ,python-django)
933 ("python-rq" ,python-rq)))
934 (home-page "https://github.com/ui/django-rq")
935 (synopsis "Django integration with RQ")
936 (description
937 "Django integration with RQ, a Redis based Python queuing library.
938 Django-RQ is a simple app that allows you to configure your queues in django's
939 settings.py and easily use them in your project.")
940 (license license:expat)))
941
942 (define-public python2-django-rq
943 (package-with-python2 python-django-rq))
944
945 (define-public python-django-q
946 (package
947 (name "python-django-q")
948 (version "1.3.2")
949 (source
950 (origin
951 (method url-fetch)
952 (uri (pypi-uri "django-q" version))
953 (sha256
954 (base32
955 "0ac3rjxv37bn97a62ly8b7qvbv765z6paiinzpwxx83nal2icc42"))))
956 (build-system python-build-system)
957 (arguments
958 '(#:phases
959 (modify-phases %standard-phases
960 (replace 'check
961 (lambda _
962 (setenv "DJANGO_SETTINGS_MODULE" "django_q.tests.settings")
963 (invoke "django-admin" "test" "django_q.tests"
964 "--pythonpath=."))))))
965 (propagated-inputs
966 `(("python-arrow" ,python-arrow)
967 ("python-blessed" ,python-blessed)
968 ("python-django" ,python-django)
969 ("python-django-picklefield" ,python-django-picklefield)))
970 (native-inputs
971 `(("python-django-redis" ,python-django-redis)
972 ("python-pytest-django" ,python-pytest-django)))
973 (home-page "https://django-q.readthedocs.io/")
974 (synopsis "Multiprocessing distributed task queue for Django")
975 (description
976 "Django Q is a native Django task queue, scheduler and worker application
977 using Python multiprocessing.")
978 (license license:expat)))
979
980 (define-public python-django-sortedm2m
981 (package
982 (name "python-django-sortedm2m")
983 (version "1.3.3")
984 (source (origin
985 (method url-fetch)
986 (uri (pypi-uri "django-sortedm2m" version))
987 (sha256
988 (base32
989 "0axf765i7b3c2s83nlph47asi8s071dhq8l7y382v1pw785s22vi"))))
990 (build-system python-build-system)
991 (arguments
992 ;; no tests.
993 `(#:tests? #f))
994 (propagated-inputs
995 `(("python-django" ,python-django)))
996 (home-page "https://github.com/gregmuellegger/django-sortedm2m")
997 (synopsis "Drop-in replacement for django's own ManyToManyField")
998 (description
999 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
1000 The provided SortedManyToManyField behaves like the original one but remembers
1001 the order of added relations.")
1002 (license license:bsd-3)))
1003
1004 (define-public python2-django-sortedm2m
1005 (package-with-python2 python-django-sortedm2m))
1006
1007 (define-public python-django-appconf
1008 (package
1009 (name "python-django-appconf")
1010 (version "1.0.3")
1011 (source (origin
1012 (method url-fetch)
1013 (uri (pypi-uri "django-appconf" version))
1014 (sha256
1015 (base32
1016 "1qw0p9qh78bvkgi38ba58djwn0rd5j1lrkg2c2wk5wb7snj3rw9m"))))
1017 (build-system python-build-system)
1018 (propagated-inputs
1019 `(("python-django" ,python-django)
1020 ("python-six" ,python-six)))
1021 (home-page "https://github.com/django-compressor/django-appconf")
1022 (synopsis "Handle configuration defaults of packaged Django apps")
1023 (description
1024 "This app precedes Django's own AppConfig classes that act as \"objects
1025 [to] store metadata for an application\" inside Django's app loading mechanism.
1026 In other words, they solve a related but different use case than
1027 django-appconf and can't easily be used as a replacement. The similarity in
1028 name is purely coincidental.")
1029 (license license:bsd-3)))
1030
1031 (define-public python2-django-appconf
1032 (package-with-python2 python-django-appconf))
1033
1034 (define-public python-django-statici18n
1035 (package
1036 (name "python-django-statici18n")
1037 (version "1.3.0")
1038 (source (origin
1039 (method url-fetch)
1040 (uri (pypi-uri "django-statici18n" version))
1041 (sha256
1042 (base32
1043 "0alcf4g1nv69njhq5k3qw4mfl2k6dc18bik5nk0g1mnp3m8zyz7k"))))
1044 (build-system python-build-system)
1045 (propagated-inputs
1046 `(("python-django" ,python-django)
1047 ("django-appconf" ,python-django-appconf)))
1048 (home-page "https://github.com/zyegfryed/django-statici18n")
1049 (synopsis "Generate JavaScript catalog to static files")
1050 (description
1051 "A Django app that provides helper for generating JavaScript catalog to
1052 static files.")
1053 (license license:bsd-3)))
1054
1055 (define-public python2-django-statici18n
1056 (package-with-python2 python-django-statici18n))
1057
1058 (define-public python-django-tagging
1059 (package
1060 (name "python-django-tagging")
1061 (version "0.5.0")
1062 (source
1063 (origin
1064 (method url-fetch)
1065 (uri (pypi-uri "django-tagging" version))
1066 (sha256
1067 (base32
1068 "13afxx30chssclxzd9gqnvwm9qyrdpnlbs6iswdfa18phfj8zmi8"))))
1069 (build-system python-build-system)
1070 (arguments
1071 `(#:phases
1072 (modify-phases %standard-phases
1073 (replace 'check
1074 (lambda _
1075 (setenv "DJANGO_SETTINGS_MODULE" "tagging.tests.settings")
1076 (invoke "django-admin" "test" "--pythonpath=."))))))
1077 (inputs
1078 `(("python-django" ,python-django)))
1079 (home-page "https://github.com/Fantomas42/django-tagging")
1080 (synopsis "Generic tagging application for Django")
1081 (description "This package provides a generic tagging application for
1082 Django projects, which allows association of a number of tags with any
1083 @code{Model} instance and makes retrieval of tags simple.")
1084 (properties `((python2-variant . ,(delay python2-django-tagging))))
1085 (license license:bsd-3)))
1086
1087 (define-public python2-django-tagging
1088 (let ((base (package-with-python2
1089 (strip-python2-variant python-django-tagging))))
1090 (package
1091 (inherit base)
1092 (version "0.4.6")
1093 (source
1094 (origin
1095 (method url-fetch)
1096 (uri (pypi-uri "django-tagging" version))
1097 (sha256
1098 (base32
1099 "0s7b4v45j783yaxs7rni10k24san0ya77nqz4s7zdf3jhfpk42r1")))))))
1100
1101 (define-public python-djangorestframework
1102 (package
1103 (name "python-djangorestframework")
1104 (version "3.7.7")
1105 (source
1106 (origin
1107 (method url-fetch)
1108 (uri (pypi-uri "djangorestframework" version))
1109 (sha256
1110 (base32
1111 "11qv117gqwswxjljs7wafxg1hyzzlx3qrviwlk9hw41bsbl997lz"))))
1112 (build-system python-build-system)
1113 (arguments
1114 '(;; No included tests
1115 #:tests? #f))
1116 (propagated-inputs
1117 `(("python-django" ,python-django)))
1118 (home-page "https://www.django-rest-framework.org")
1119 (synopsis "Toolkit for building Web APIs with Django")
1120 (description
1121 "The Django REST framework is for building Web APIs with Django. It
1122 provides features like a web browseable API and authentication policies.")
1123 (license license:bsd-2)))
1124
1125 (define-public python-django-sekizai
1126 (package
1127 (name "python-django-sekizai")
1128 (version "1.1.0")
1129 (source
1130 (origin
1131 (method url-fetch)
1132 (uri (pypi-uri "django-sekizai" version))
1133 (sha256
1134 (base32
1135 "1nc4sv109valdn6azmgm2j01k7khxy2wnji84z63x7fxsikfdxp2"))))
1136 (build-system python-build-system)
1137 (arguments '(#:tests? #f)) ; Tests not included with release.
1138 (propagated-inputs
1139 `(("python-django" ,python-django)
1140 ("python-django-classy-tags" ,python-django-classy-tags)
1141 ("python-six" ,python-six)))
1142 (home-page "https://github.com/divio/django-sekizai")
1143 (synopsis "Template blocks for Django projects")
1144 (description "Sekizai means blocks in Japanese, and thats what this app
1145 provides. A fresh look at blocks. With @code{django-sekizai} you can define
1146 placeholders where your blocks get rendered and at different places in your
1147 templates append to those blocks. This is especially useful for css and
1148 javascript. Your subtemplates can now define css and javscript files to be
1149 included, and the css will be nicely put at the top and the javascript to the
1150 bottom, just like you should. Also sekizai will ignore any duplicate content in
1151 a single block.")
1152 (license license:bsd-3)))
1153
1154 (define-public python-django-crispy-forms
1155 (package
1156 (name "python-django-crispy-forms")
1157 (version "1.7.2")
1158 (source
1159 (origin
1160 (method url-fetch)
1161 (uri (pypi-uri "django-crispy-forms" version))
1162 (sha256
1163 (base32
1164 "0pv7y648i8iz7mf64gkjizpbx5d01ap2s4vqqa30n38if6wvlljr"))))
1165 (build-system python-build-system)
1166 (arguments
1167 '(;; No included tests
1168 #:tests? #f))
1169 (propagated-inputs
1170 `(("python-django" ,python-django)))
1171 (home-page
1172 "http://github.com/maraujop/django-crispy-forms")
1173 (synopsis "Tool to control Django forms without custom templates")
1174 (description
1175 "@code{django-crispy-forms} lets you easily build, customize and reuse
1176 forms using your favorite CSS framework, without writing template code.")
1177 (license license:expat)))
1178
1179 (define-public python-django-compressor
1180 (package
1181 (name "python-django-compressor")
1182 (version "2.4")
1183 (source
1184 (origin
1185 (method url-fetch)
1186 (uri (pypi-uri "django_compressor" version))
1187 (sha256
1188 (base32
1189 "0kx7bclfa0sxlsz6ka70zr9ra00lks0hmv1kc99wbanx6xhirvfj"))))
1190 (build-system python-build-system)
1191 (arguments
1192 '(#:phases
1193 (modify-phases %standard-phases
1194 (replace 'check
1195 (lambda* (#:key tests? #:allow-other-keys)
1196 (if tests?
1197 (begin
1198 (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
1199 (invoke "django-admin" "test"
1200 "--pythonpath=."))
1201 #t))))
1202 ;; Tests fail with beautifulsoup 4.9+
1203 ;; https://github.com/django-compressor/django-compressor/issues/998
1204 #:tests? #f))
1205 (propagated-inputs
1206 `(("python-django-appconf" ,python-django-appconf)
1207 ("python-rcssmin" ,python-rcssmin)
1208 ("python-rjsmin" ,python-rjsmin)))
1209 (native-inputs
1210 `(("python-beautifulsoup4" ,python-beautifulsoup4)
1211 ("python-brotli" ,python-brotli)
1212 ("python-csscompressor" ,python-csscompressor)
1213 ("python-django-sekizai" ,python-django-sekizai)
1214 ("python-mock" ,python-mock)))
1215 (home-page "https://django-compressor.readthedocs.io/en/latest/")
1216 (synopsis
1217 "Compress linked and inline JavaScript or CSS into single cached files")
1218 (description
1219 "Django Compressor combines and compresses linked and inline Javascript or
1220 CSS in a Django templates into cacheable static files by using the compress
1221 template tag.")
1222 (license license:expat)))
1223
1224 (define-public python-django-override-storage
1225 (package
1226 (name "python-django-override-storage")
1227 (version "0.1.6")
1228 (source
1229 (origin
1230 (method url-fetch)
1231 (uri (pypi-uri "django-override-storage" version))
1232 (sha256
1233 (base32 "022arq94lxnlyykn8wvfnkykhi2dldnsn93pa2i41na551i0wpiv"))))
1234 (build-system python-build-system)
1235 (propagated-inputs
1236 `(("python-django" ,python-django)))
1237 (home-page
1238 "https://github.com/danifus/django-override-storage")
1239 (synopsis "Django test helpers to manage file storage side effects")
1240 (description
1241 "This project provides tools to help reduce the side effects of using
1242 FileFields during tests.")
1243 (license license:expat)))