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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
47 (define-public python-django
49 (name "python-django")
53 (uri (pypi-uri "Django" version))
56 "0gffaabnnpzj0sl3jl7mllvi3gc0jvab6xw2bckvyljwsrd1j78a"))))
57 (build-system python-build-system)
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.
66 (string-append (assoc-ref inputs "tzdata")
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"
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 = ['"
84 (string-split (getenv "PYTHONPATH") #\:)
90 (lambda* (#:key tests? #:allow-other-keys)
92 (with-directory-excursion "tests"
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.
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.
107 ;; TODO: Install extras/django_bash_completion.
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)))
121 `(("python-asgiref" ,python-asgiref)
122 ("python-pytz" ,python-pytz)
123 ("python-sqlparse" ,python-sqlparse)
125 ;; Optional dependencies.
126 ("python-argon2-cffi" ,python-argon2-cffi)
127 ("python-bcrypt" ,python-bcrypt)
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")
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")))))
142 (define-public python-django-2.2
144 (inherit python-django)
148 (uri (pypi-uri "Django" version))
151 "0q30zjcmnvwp1v1syn739wapahs2dx784n0yjyypq0cr3kdi88nv"))))
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)))))
157 (define-public python-django-extensions
159 (name "python-django-extensions")
164 ;; Fetch from the git repository, so that the tests can be run.
166 (url "https://github.com/django-extensions/django-extensions")
168 (file-name (string-append name "-" version))
171 "0sra6hazqvspxd1pnx5cj7gia1rkaz3hn06ib4wd0frc167f5afy"))))
172 (build-system python-build-system)
174 '(#:tests? #f)) ;XXX: requires a Postgres or MySQL database
176 `(("python-six" ,python-six)
177 ("python-vobject" ,python-vobject)
178 ("python-werkzeug" ,python-werkzeug)
179 ("python-dateutil" ,python-dateutil)))
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)))
190 "https://github.com/django-extensions/django-extensions")
191 (synopsis "Custom management extensions for Django")
193 "Django-extensions extends Django providing, for example, management
194 commands, additional database fields and admin extensions.")
195 (license license:expat)))
197 (define-public python-django-simple-math-captcha
199 (name "python-django-simple-math-captcha")
201 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
206 (commit (string-append "v" version))))
207 (file-name (git-file-name name version))
210 "0fhy9k8haqa1296v0qpg1b5w7y3pyw9qi9z9laj5ijry1gk35qaw"))))
211 (build-system python-build-system)
213 '(#:phases (modify-phases %standard-phases
214 (add-after 'unpack 'patch-six-imports
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")
225 (invoke "python" "runtests.py"))))))
227 `(("python-django" ,python-django)
228 ("python-mock" ,python-mock)))
230 `(("python-six" ,python-six)))
231 (synopsis "Easy-to-use math field/widget captcha for Django forms")
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)))
238 (define-public python-django-classy-tags
240 (name "python-django-classy-tags")
245 (uri (pypi-uri "django-classy-tags" version))
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")
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)))
261 (define-public python-django-taggit
263 (name "python-django-taggit")
268 (uri (pypi-uri "django-taggit" version))
271 "0bbkabbs77z229ps0800gxfhf75yagp4x4j5jzfysbac3zvkp0sa"))))
272 (build-system python-build-system)
275 (modify-phases %standard-phases
278 (invoke "python3" "-m" "django" "test" "--settings=tests.settings"))))))
280 `(("python-isort" ,python-isort)))
282 `(("python-django" ,python-django)
283 ("python-pytest" ,python-pytest)
284 ("python-mock" ,python-mock)))
286 "https://github.com/jazzband/django-taggit")
288 "Reusable Django application for simple tagging")
290 "Django-taggit is a reusable Django application for simple tagging.")
291 (license license:bsd-3)))
293 (define-public python-easy-thumbnails
295 (name "python-easy-thumbnails")
300 (uri (pypi-uri "easy-thumbnails" version))
303 "14gzp5cv24z0qhxb7f7k7v9jgzpaj4n8yhjq83ynpx8183fs1rz4"))))
304 (build-system python-build-system)
306 `(("python-django" ,python-django)))
308 `(("python-pillow" ,python-pillow)))
309 (home-page "https://github.com/SmileyChris/easy-thumbnails")
310 (synopsis "Easy thumbnails for Django")
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
316 (license license:bsd-3)))
318 (define-public python-pytest-django
320 (name "python-pytest-django")
324 (uri (pypi-uri "pytest-django" version))
327 "19nvqsb7b9kz3ikpb50m8ppf7mfhzrapdxsqd5hhd1pdfz8dprjd"))))
328 (build-system python-build-system)
331 (modify-phases %standard-phases
333 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
336 (add-installed-pythonpath inputs outputs)
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~%"))
353 `(("python-django" ,python-django)
354 ("python-setuptools-scm" ,python-setuptools-scm)
357 ("python-pytest-xdist" ,python-pytest-xdist)))
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)))
366 (define-public python-django-haystack
368 (name "python-django-haystack")
373 (uri (pypi-uri "django-haystack" version))
376 "1302fqsrx8w474xk5cmnmg3hjqfprlxnjg9qlg86arsr4v4vqm4b"))))
377 (build-system python-build-system)
380 (modify-phases %standard-phases
381 (add-after 'unpack 'loosen-verion-restrictions
383 (substitute* "setup.py"
384 (("geopy.*") "geopy',\n"))
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")
392 #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file
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
411 (license license:bsd-3)))
413 (define-public python-django-filter
415 (name "python-django-filter")
419 (uri (pypi-uri "django-filter" version))
422 "1bz5qzdk9pk4a2lp2yacrdnqmkv24vxnz4k3lykrnpc3b7bkvrhi"))))
423 (build-system python-build-system)
426 (modify-phases %standard-phases
429 (invoke "python" "runtests.py"))))))
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")
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
442 (license license:bsd-3)))
444 (define-public python-django-allauth
446 (name "python-django-allauth")
451 (uri (pypi-uri "django-allauth" version))
454 "0c0x8izvrnjhrr48w6pwsfk9ddbi6yfxg7v3hh5dm1vz1d0hjwpi"))))
455 (build-system python-build-system)
458 (modify-phases %standard-phases
461 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
462 (invoke "django-admin" "test" "allauth.tests"
463 "--pythonpath=."))))))
465 `(("python-openid" ,python-openid)
466 ("python-requests" ,python-requests)
467 ("python-requests-oauthlib" ,python-requests-oauthlib)))
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")
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)))
479 (define-public python-django-debug-toolbar
481 (name "python-django-debug-toolbar")
487 (url "https://github.com/jazzband/django-debug-toolbar")
489 (file-name (git-file-name name version))
492 "1m1j2sx7q0blma0miswj3c8hrfi5q4y5cq2b816v8gagy89xgc57"))))
493 (build-system python-build-system)
495 `(("python-sqlparse" ,python-sqlparse)))
497 `(("python-django" ,python-django)
498 ("python-django-jinja" ,python-django-jinja)
499 ("python-html5lib" ,python-html5lib)))
502 (modify-phases %standard-phases
505 (invoke "make" "test"))))))
507 "https://github.com/jazzband/django-debug-toolbar")
508 (synopsis "Toolbar to help with developing Django applications")
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)))
514 (define-public python-django-debug-toolbar-alchemy
516 (name "python-django-debug-toolbar-alchemy")
518 (home-page "https://github.com/miki725/django-debug-toolbar-alchemy")
521 (uri (pypi-uri "django-debug-toolbar-alchemy" version))
524 "1kmpzghnsc247bc1dl22s4y62k9ijgy1pjms227018h5a4frsa5b"))))
525 (build-system python-build-system)
526 (arguments '(#:tests? #f)) ;XXX: 'make check' does "echo TODO"
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")
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)))
539 (define-public python-django-gravatar2
541 (name "python-django-gravatar2")
546 (uri (pypi-uri "django-gravatar2" version))
549 "1vn921fb6jjx7rf5dzhy66rkb71nwmh9ydd0xs9ys72icw4jh4y8"))))
550 (build-system python-build-system)
552 '(;; TODO: The django project for the tests is missing from the release.
555 `(("python-django" ,python-django)))
556 (home-page "https://github.com/twaddington/django-gravatar")
557 (synopsis "Gravatar support for Django, improved version")
559 "Essential Gravatar support for Django. Features helper methods,
560 templatetags and a full test suite.")
561 (license license:expat)))
563 (define-public python-django-assets
565 (name "python-django-assets")
569 (uri (pypi-uri "django-assets" version))
572 "0fc6i77faxxv1gjlp06lv3kw64b5bhdiypaygfxh5djddgk83fwa"))))
573 (build-system python-build-system)
575 `(("python-django" ,python-django)
576 ("python-nose" ,python-nose)))
578 `(("python-webassets" ,python-webassets)))
579 (home-page "https://github.com/miracle2k/django-assets")
580 (synopsis "Asset management for Django")
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)))
587 (define-public python-django-jinja
589 (name "python-django-jinja")
595 (url "https://github.com/niwinz/django-jinja")
597 (file-name (git-file-name name version))
600 "06ldbkfkm6sc0p9sqpjph06gxrqpj78ih3dc2yik2fcba2y5mak1"))))
601 (build-system python-build-system)
603 `(("python-jinja2" ,python-jinja2)
604 ("python-pytz" ,python-pytz)
605 ("python-django-pipeline" ,python-django-pipeline)))
607 '(;; TODO Tests currently fail due to issues with the configuration for
611 (modify-phases %standard-phases
613 (lambda* (#:key tests? #:allow-other-keys)
616 (with-directory-excursion "testing"
617 (invoke "python" "runtests.py"))))))))
619 "https://niwinz.github.io/django-jinja/latest/")
620 (synopsis "Simple jinja2 templating backend for Django")
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)))
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))
631 (define-public python-dj-database-url
633 (name "python-dj-database-url")
637 (uri (pypi-uri "dj-database-url" version))
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")
645 "This simple Django utility allows you to utilize the 12factor inspired
646 DATABASE_URL environment variable to configure your Django application.
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)))
653 (define-public python-django-picklefield
655 (name "python-django-picklefield")
657 (home-page "https://github.com/gintas/django-picklefield")
658 ;; Use a git checkout because the PyPI release lacks tests.
664 (commit (string-append "v" version))))
665 (file-name (git-file-name name version))
668 "0ni7bc86k0ra4pc8zv451pzlpkhs1nyil1sq9jdb4m2mib87b5fk"))))
669 (build-system python-build-system)
671 '(#:phases (modify-phases %standard-phases
674 (invoke "python" "-m" "django" "test" "-v2"
675 "--settings=tests.settings"))))))
677 ;; XXX: Picklefield has not been updated in 10+ years and fails tests
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)))
684 (define-public python-django-bulk-update
686 (name "python-django-bulk-update")
690 (uri (pypi-uri "django-bulk-update" version))
693 "0dxkmrm3skyw82i0qa8vklxw1ma1y308kh9w2hcnvhpacn5cxdss"))))
694 (build-system python-build-system)
696 ;; XXX: Tests require a Postgres database.
698 (home-page "https://github.com/aykut/django-bulk-update")
699 (synopsis "Simple bulk update over Django ORM or with helper function")
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)))
705 (define-public python-django-contact-form
707 (name "python-django-contact-form")
711 (uri (pypi-uri "django-contact-form" version))
714 "1zv7bcjfrg32gcsq3bclkld79l6mcy2wcvlj81h7q2ppv1wm8vqs"))))
715 (build-system python-build-system)
718 (modify-phases %standard-phases
722 (string-append "./build/lib:"
723 (getenv "PYTHONPATH")))
724 (invoke "coverage" "run" "--source" "contact_form"
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")
732 "This application provides simple, extensible contact-form functionality
734 (license license:bsd-3)))
736 (define-public python-django-contrib-comments
738 (name "python-django-contrib-comments")
742 (uri (pypi-uri "django-contrib-comments" version))
745 "0ccdiv784a5vnpfal36km4dyg12340rwhpr0riyy0k89wfnjn8yi"))))
746 (build-system python-build-system)
748 `(("python-django" ,python-django)))
750 `(("python-six" ,python-six)))
751 (home-page "https://github.com/django/django-contrib-comments")
752 (synopsis "Comments framework")
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)))
760 (define-public python-django-pipeline
762 (name "python-django-pipeline")
767 (uri (pypi-uri "django-pipeline" version))
770 "19vrbd5s12qw4qlg5n8ldv7zz2rs5y2sdid1i7lvgp92m71dayvc"))))
771 (build-system python-build-system)
774 (modify-phases %standard-phases
775 (add-after 'unpack 'patch-source
777 (substitute* "tests/tests/test_compiler.py"
778 (("\\/usr\\/bin\\/env")
781 (lambda*(#:key tests? #:allow-other-keys)
786 (string-append (getcwd) ":"
787 (getenv "PYTHONPATH")))
788 (setenv "DJANGO_SETTINGS_MODULE" "tests.settings")
789 (invoke "django-admin" "test" "tests"))))))))
791 `(("python-django" ,python-django)))
793 `(("python-css-html-js-minify" ,python-css-html-js-minify)
794 ("python-slimit" ,python-slimit)
795 ("python-jsmin" ,python-jsmin)))
797 "https://github.com/jazzband/django-pipeline")
798 (synopsis "Asset packaging library for Django")
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)))
805 (define-public python-django-redis
807 (name "python-django-redis")
811 (uri (pypi-uri "django-redis" version))
814 "0qvsm8yjchl0d3i7g20wba6px9lb5gv8kp3fcnr6hr0y0b3qjr9h"))))
815 (build-system python-build-system)
818 (modify-phases %standard-phases
821 (invoke "redis-server" "--daemonize" "yes")
822 (with-directory-excursion "tests"
823 (invoke "python" "runtests.py")))))))
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)
832 `(("python-redis" ,python-redis)))
833 (home-page "https://github.com/niwibe/django-redis")
834 (synopsis "Full featured redis cache backend for Django")
836 "Full featured redis cache backend for Django.")
837 (license license:bsd-3)))
839 (define-public python-django-rq
841 (name "python-django-rq")
845 (uri (pypi-uri "django-rq" version))
848 "0lksnjn3q3f7y72bj2yr8870w28a5b6x0vjnd9nhpq2ah6xfz6pf"))))
849 (build-system python-build-system)
852 (modify-phases %standard-phases
855 (invoke "redis-server" "--daemonize" "yes")
856 (invoke "django-admin.py" "test" "django_rq"
857 "--settings=django_rq.tests.settings"
858 "--pythonpath=."))))))
860 `(("python-django" ,python-django)
861 ("python-django-redis" ,python-django-redis)
862 ("python-mock" ,python-mock)
863 ("python-rq-scheduler" ,python-rq-scheduler)
866 `(("python-rq" ,python-rq)))
867 (home-page "https://github.com/ui/django-rq")
868 (synopsis "Django integration with RQ")
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)))
875 (define-public python-django-q
877 (name "python-django-q")
882 (uri (pypi-uri "django-q" version))
884 (base32 "03z1pf6wlf47i7afr79a8fiiidfk1vq19yaqnv0m4qdny7f58gaj"))))
885 (build-system python-build-system)
886 ;; FIXME: Tests require disque, Redis, MongoDB, Docker.
887 (arguments '(#:tests? #f))
889 `(("python-django" ,python-django)))
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")
897 "Django Q is a native Django task queue, scheduler and worker application
898 using Python multiprocessing.")
899 (license license:expat)))
901 (define-public python-django-sortedm2m
903 (name "python-django-sortedm2m")
907 (uri (pypi-uri "django-sortedm2m" version))
910 "0z0yymmrr2l5cznqbzwziw624df0qsiflvbpqwrpan52nww3dk4a"))))
911 (build-system python-build-system)
913 `(#:phases (modify-phases %standard-phases
916 (setenv "PYTHONPATH" (string-append "./test_project:"
918 (getenv "PYTHONPATH")))
919 (invoke "django-admin.py" "test" "--settings=settings"))))))
921 `(("python-django" ,python-django)))
922 (home-page "https://github.com/jazzband/django-sortedm2m")
923 (synopsis "Drop-in replacement for django's own ManyToManyField")
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)))
930 (define-public python-django-appconf
932 (name "python-django-appconf")
936 (uri (pypi-uri "django-appconf" version))
939 "101k8nkc7xlffpjdi2qbrp9pc4v8hzvmkzi12qp7vms39asxwn5y"))))
940 (build-system python-build-system)
942 '(#:phases (modify-phases %standard-phases
945 (setenv "PYTHONPATH" (string-append ".:"
946 (getenv "PYTHONPATH")))
947 (setenv "DJANGO_SETTINGS_MODULE" "tests.test_settings")
948 (invoke "django-admin.py" "test" "-v2"))))))
950 `(("python-django" ,python-django)))
951 (home-page "https://github.com/django-compressor/django-appconf")
952 (synopsis "Handle configuration defaults of packaged Django apps")
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)))
961 (define-public python-django-statici18n
963 (name "python-django-statici18n")
965 (home-page "https://github.com/zyegfryed/django-statici18n")
970 (commit (string-append "v" version))))
971 (file-name (git-file-name name version))
974 "0x0xvfqd40is2ks43d65awgqkx3wk10lvdim15scvbjhkh301b6v"))))
975 (build-system python-build-system)
977 '(#:phases (modify-phases %standard-phases
981 (string-append "./tests/test_project:./build/lib:"
982 (getenv "PYTHONPATH")))
983 (setenv "DJANGO_SETTINGS_MODULE" "project.settings")
984 (invoke "pytest" "-vv"))))))
986 `(("python-django" ,python-django)
987 ("python-pytest" ,python-pytest)
988 ("python-pytest-django" ,python-pytest-django)))
990 `(("django-appconf" ,python-django-appconf)))
991 (synopsis "Generate JavaScript catalog to static files")
993 "A Django app that provides helper for generating JavaScript catalog to
995 (license license:bsd-3)))
997 (define-public python-django-tagging
999 (name "python-django-tagging")
1004 (uri (pypi-uri "django-tagging" version))
1007 "13afxx30chssclxzd9gqnvwm9qyrdpnlbs6iswdfa18phfj8zmi8"))))
1008 (build-system python-build-system)
1011 (modify-phases %standard-phases
1014 (setenv "DJANGO_SETTINGS_MODULE" "tagging.tests.settings")
1015 (invoke "django-admin" "test" "--pythonpath=."))))))
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)))
1025 (define-public python-djangorestframework
1027 (name "python-djangorestframework")
1033 (url "https://github.com/encode/django-rest-framework")
1035 (file-name (git-file-name name version))
1038 "16n17dw35wqv47m8k8fixn0yywrvd6v4r573yr4nx6lbbiyi2cqn"))))
1039 (build-system python-build-system)
1042 (modify-phases %standard-phases
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):"))
1052 (invoke "python" "runtests.py" "--nolint")
1053 (format #t "test suite not run~%")))))))
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")
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)))
1065 (define-public python-django-sekizai
1067 (name "python-django-sekizai")
1072 (uri (pypi-uri "django-sekizai" version))
1075 "0vrkli625b5s1wldri3dyrfvqbxg7zxy2pg0rpjixw3b1ndz0ag8"))))
1076 (build-system python-build-system)
1077 (arguments '(#:tests? #f)) ; Tests not included with release.
1079 `(("python-django" ,python-django)))
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
1093 (license license:bsd-3)))
1095 (define-public python-django-crispy-forms
1097 (name "python-django-crispy-forms")
1102 (uri (pypi-uri "django-crispy-forms" version))
1105 "0fxlf233f49hjax786p4r650rd0ilvhnpyvw8hv1d1aqnkxy1wgj"))))
1106 (build-system python-build-system)
1108 '(;; No included tests
1111 `(("python-django" ,python-django)))
1113 "http://github.com/maraujop/django-crispy-forms")
1114 (synopsis "Tool to control Django forms without custom templates")
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)))
1120 (define-public python-django-compressor
1122 (name "python-django-compressor")
1127 (uri (pypi-uri "django_compressor" version))
1130 "0kx7bclfa0sxlsz6ka70zr9ra00lks0hmv1kc99wbanx6xhirvfj"))))
1131 (build-system python-build-system)
1134 (modify-phases %standard-phases
1136 (lambda* (#:key tests? #:allow-other-keys)
1139 (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
1140 (invoke "django-admin" "test"
1143 ;; Tests fail with beautifulsoup 4.9+
1144 ;; https://github.com/django-compressor/django-compressor/issues/998
1147 `(("python-django-appconf" ,python-django-appconf)
1148 ("python-rcssmin" ,python-rcssmin)
1149 ("python-rjsmin" ,python-rjsmin)))
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/")
1158 "Compress linked and inline JavaScript or CSS into single cached files")
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
1163 (license license:expat)))
1165 (define-public python-django-override-storage
1167 (name "python-django-override-storage")
1169 (home-page "https://github.com/danifus/django-override-storage")
1175 (commit (string-append "v" version))))
1176 (file-name (git-file-name name version))
1178 (base32 "081kzfk7mmybhihvc92d3hsdg0r2k20ydq88fs1fgd348sq1ax51"))))
1179 (build-system python-build-system)
1181 '(#:phases (modify-phases %standard-phases
1184 (invoke "python" "runtests.py"))))))
1186 `(("python-django" ,python-django)
1187 ("python-mock" ,python-mock)))
1188 (synopsis "Django test helpers to manage file storage side effects")
1190 "This project provides tools to help reduce the side effects of using
1191 FileFields during tests.")
1192 (license license:expat)))
1194 (define-public python-django-auth-ldap
1196 (name "python-django-auth-ldap")
1200 (uri (pypi-uri "django-auth-ldap" version))
1203 "0xk6cxiqz5j3q79bd54x64f26alrlc8p7k9wkp2c768w2k1vzz30"))))
1204 (build-system python-build-system)
1206 '(#:phases (modify-phases %standard-phases
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"))
1214 (string-append openldap "/etc/openldap/schema"))
1215 (invoke "python" "-m" "django" "test"
1216 "--settings" "tests.settings")))))))
1218 `(("openldap" ,openldap)
1219 ("python-django" ,python-django)
1220 ("python-mock" ,python-mock)))
1222 `(("python-ldap" ,python-ldap)))
1223 (home-page "https://github.com/django-auth-ldap/django-auth-ldap")
1224 (synopsis "Django LDAP authentication backend")
1226 "This package provides an LDAP authentication backend for Django.")
1227 (license license:bsd-2)))
1229 (define-public python-django-logging-json
1231 (name "python-django-logging-json")
1235 (uri (pypi-uri "django-logging-json" version))
1238 "06041a8icazzp73kg93c7k1ska12wvkq7fpcad0l0sm1qnxx5yx7"))))
1239 (build-system python-build-system)
1240 (arguments '(#:tests? #f)) ;no tests
1242 `(("python-django" ,python-django)))
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")
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
1253 (license license:bsd-2)))
1255 (define-public python-django-netfields
1257 (name "python-django-netfields")
1261 (uri (pypi-uri "django-netfields" version))
1264 "1c47azr5am0q8g45x0fbn0cay7vyrack6n7k6siliw1j2p0gzi7s"))))
1265 (build-system python-build-system)
1266 (arguments '(#:tests? #f)) ;XXX: Requires a running PostgreSQL server
1268 `(("python-django" ,python-django)))
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")
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)))
1279 (define-public python-django-url-filter
1281 (name "python-django-url-filter")
1283 (home-page "https://github.com/miki725/django-url-filter")
1286 (uri (git-reference (url home-page) (commit version)))
1287 (file-name (git-file-name name version))
1290 "0r4zhqhs8y6cnplwyvcb0zpijizw1ifnszs38n4w8138657f9026"))))
1291 (build-system python-build-system)
1293 '(#:tests? #f ;FIXME: Django raises "Apps aren't loaded yet"!?
1294 #:phases (modify-phases %standard-phases
1295 (add-before 'check 'loosen-requirements
1297 ;; Do not depend on compatibility package for old
1299 (substitute* "requirements.txt"
1300 (("enum-compat") ""))
1303 (lambda* (#:key tests? #:allow-other-keys)
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~%")))))))
1315 `(("python-django" ,python-django)))
1317 `(("python-cached-property" ,python-cached-property)
1318 ("python-six" ,python-six)))
1319 (synopsis "Filter data via human-friendly URLs")
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)))