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, 2022 Marius Bakke <marius@gnu.org>
10 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
11 ;;; Copyright © 2021 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages django)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix gexp)
34 #:use-module (guix build-system python)
35 #:use-module (guix deprecation)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages databases)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages finance)
42 #:use-module (gnu packages geo)
43 #:use-module (gnu packages openldap)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-build)
46 #:use-module (gnu packages python-crypto)
47 #:use-module (gnu packages python-web)
48 #:use-module (gnu packages python-xyz)
49 #:use-module (gnu packages sphinx)
50 #:use-module (gnu packages time)
51 #:use-module (gnu packages xml))
53 (define-public python-django-4.0
55 (name "python-django")
59 (uri (pypi-uri "Django" version))
62 "0jlmxylag7dah9jl3wm2swnn9kbisx1gqnddfbh5kjifn67va3qi"))))
63 (build-system python-build-system)
66 (modify-phases %standard-phases
67 (add-before 'check 'pre-check
68 (lambda* (#:key inputs #:allow-other-keys)
69 ;; The test-suite tests timezone-dependent functions, thus tzdata
70 ;; needs to be available.
72 (search-input-directory inputs "share/zoneinfo"))
74 ;; Disable test for incorrect timezone: it only raises the
75 ;; expected error when /usr/share/zoneinfo exists, even though
76 ;; the machinery gracefully falls back to TZDIR. According to
77 ;; django/conf/__init__.py, lack of /usr/share/zoneinfo is
78 ;; harmless, so just ignore this test.
79 (substitute* "tests/settings_tests/tests.py"
80 ((".*def test_incorrect_timezone.*" all)
81 (string-append " @unittest.skipIf(True, 'Disabled by Guix')\n"
84 (lambda* (#:key tests? #:allow-other-keys)
86 (with-directory-excursion "tests"
87 ;; Tests expect PYTHONPATH to contain the root directory.
88 (setenv "PYTHONPATH" "..")
89 (invoke "python" "runtests.py"
90 ;; By default tests run in parallel, which may cause
91 ;; various race conditions. Run sequentially for
92 ;; consistent results.
94 (format #t "test suite not run~%"))))
95 ;; XXX: The 'wrap' phase adds native inputs as runtime dependencies,
96 ;; see <https://bugs.gnu.org/25235>. The django-admin script typically
97 ;; runs in an environment that has Django and its dependencies on
98 ;; PYTHONPATH, so just disable the wrapper to reduce the size from
99 ;; ~710 MiB to ~203 MiB.
101 ;; TODO: Install extras/django_bash_completion.
103 (list tzdata-for-tests
104 ;; Remaining packages are test requirements taken from
105 ;; tests/requirements/py3.txt
107 ;; optional for tests: ("python-geoip2" ,python-geoip2)
108 ;; optional for tests: ("python-memcached" ,python-memcached)
112 ;; optional for tests: ("python-selenium" ,python-selenium)
117 ;; Optional dependencies.
120 ;; This input is not strictly required, but in practice many Django
121 ;; libraries need it for test suites and similar.
124 ;; Set TZDIR when 'tzdata' is available so that timezone functionality
125 ;; works (mostly) out of the box in containerized environments.
126 ;; Note: This search path actually belongs to 'glibc'.
127 (list (search-path-specification
129 (files '("share/zoneinfo")))))
130 (home-page "https://www.djangoproject.com/")
131 (synopsis "High-level Python Web framework")
133 "Django is a high-level Python Web framework that encourages rapid
134 development and clean, pragmatic design. It provides many tools for building
135 any Web site. Django focuses on automating as much as possible and adhering
136 to the @dfn{don't repeat yourself} (DRY) principle.")
137 (license license:bsd-3)
138 (properties `((cpe-name . "django")))))
140 (define-public python-django-3.2
142 (inherit python-django-4.0)
146 (uri (pypi-uri "Django" version))
149 "1qj1kvb6mk2f4b33n4n5l4rh5kqllrk2v0v076crxr83ay9ycwlp"))))
150 (native-search-paths '()) ;no need for TZDIR
152 (modify-inputs (package-propagated-inputs python-django-4.0)
153 ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
154 (append python-pytz)))))
156 (define-public python-django-2.2
158 (inherit python-django-3.2)
162 (uri (pypi-uri "Django" version))
165 "04y9knxd8v9jn54ws5rbdwxyq5im69kx009s7gl62axzn1371qqy"))))
167 (modify-inputs (package-native-inputs python-django-3.2)
168 (prepend ;; 2.2 requires Selenium for the test suite.
171 ;; Use 3.2 LTS as the default until packages gain support for 4.x.
172 (define-public python-django python-django-3.2)
174 (define-public python-django-extensions
176 (name "python-django-extensions")
181 ;; Fetch from the git repository, so that the tests can be run.
183 (url "https://github.com/django-extensions/django-extensions")
185 (file-name (string-append name "-" version))
188 "0sra6hazqvspxd1pnx5cj7gia1rkaz3hn06ib4wd0frc167f5afy"))))
189 (build-system python-build-system)
191 '(#:tests? #f)) ;XXX: requires a Postgres or MySQL database
193 (list python-six python-vobject python-werkzeug python-dateutil
204 "https://github.com/django-extensions/django-extensions")
205 (synopsis "Custom management extensions for Django")
207 "Django-extensions extends Django providing, for example, management
208 commands, additional database fields and admin extensions.")
209 (license license:expat)))
211 (define-public python-django-localflavor
213 (name "python-django-localflavor")
218 (uri (pypi-uri "django-localflavor" version))
220 (base32 "0i1s0ijfd9rv2cp5x174jcyjpwn7fyg7s1wpbvlwm96bpdvs6bxc"))))
221 (build-system python-build-system)
224 (modify-phases %standard-phases
226 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
228 (add-installed-pythonpath inputs outputs)
231 (getenv "GUIX_PYTHONPATH")))
232 (invoke "invoke" "test")))))))
234 (list python-coverage python-invoke python-pytest-django which))
236 (list python-django python-stdnum))
237 (home-page "https://django-localflavor.readthedocs.io/en/latest/")
238 (synopsis "Country-specific Django helpers")
239 (description "Django-LocalFlavor is a collection of assorted pieces of code
240 that are useful for particular countries or cultures.")
241 (license license:bsd-3)))
243 (define-public python-django-simple-math-captcha
245 (name "python-django-simple-math-captcha")
247 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
252 (commit (string-append "v" version))))
253 (file-name (git-file-name name version))
256 "0fhy9k8haqa1296v0qpg1b5w7y3pyw9qi9z9laj5ijry1gk35qaw"))))
257 (build-system python-build-system)
259 '(#:phases (modify-phases %standard-phases
260 (add-after 'unpack 'patch-six-imports
262 ;; Django no longer bundles six, adjust the imports
263 ;; accordingly. The six dependency can likely be
264 ;; removed in the next version.
265 (substitute* (find-files "." "\\.py$")
266 (("from django\\.utils import six")
271 (invoke "python" "runtests.py"))))))
275 (list python-django python-six))
276 (synopsis "Easy-to-use math field/widget captcha for Django forms")
278 "A multi-value-field that presents a human answerable question,
279 with no settings.py configuration necessary, but instead can be configured
280 with arguments to the field constructor.")
281 (license license:asl2.0)))
283 (define-public python-django-classy-tags
285 (name "python-django-classy-tags")
290 (uri (pypi-uri "django-classy-tags" version))
293 "1javam3zqi3y3j0r490mm61v48yh75jaha99gb7lsxkaz6yri7fm"))))
294 (build-system python-build-system)
295 ;; FIXME: How to make the test templates available to Django?
296 (arguments '(#:tests? #f))
298 (list python-django))
299 (home-page "https://github.com/divio/django-classy-tags")
300 (synopsis "Class based template tags for Django")
302 "@code{django-classy-tags} is an approach at making writing template tags
303 in Django easier, shorter and more fun. It provides an extensible argument
304 parser which reduces most of the boiler plate code you usually have to write
305 when coding custom template tags.")
306 (license license:bsd-3)))
308 (define-public python-django-taggit
310 (name "python-django-taggit")
315 (uri (pypi-uri "django-taggit" version))
318 "0bbkabbs77z229ps0800gxfhf75yagp4x4j5jzfysbac3zvkp0sa"))))
319 (build-system python-build-system)
322 (modify-phases %standard-phases
325 (invoke "python3" "-m" "django" "test" "--settings=tests.settings"))))))
327 (list python-django python-isort))
329 (list python-pytest python-mock))
331 "https://github.com/jazzband/django-taggit")
333 "Reusable Django application for simple tagging")
335 "Django-taggit is a reusable Django application for simple tagging.")
336 (license license:bsd-3)))
338 (define-public python-easy-thumbnails
340 (name "python-easy-thumbnails")
345 (uri (pypi-uri "easy-thumbnails" version))
348 "14gzp5cv24z0qhxb7f7k7v9jgzpaj4n8yhjq83ynpx8183fs1rz4"))))
349 (build-system python-build-system)
351 (list python-django python-pillow))
352 (home-page "https://github.com/SmileyChris/easy-thumbnails")
353 (synopsis "Easy thumbnails for Django")
355 "Easy thumbnails is a Django plugin to dynamically create thumbnails
356 based on source images. Multiple thumbnails can be created from a single
357 source image, using different options to control parameters like the image
359 (license license:bsd-3)))
361 (define-public python-pytest-django
363 (name "python-pytest-django")
367 (uri (pypi-uri "pytest-django" version))
370 "0mglnz0w6k7dgw1jn6giv56pmdjd6a3zwwkhxb2kyzmzk0viw5xm"))))
371 (build-system python-build-system)
373 ;; The test suite is disabled because there are many test failures (see:
374 ;; https://github.com/pytest-dev/pytest-django/issues/943).
377 (modify-phases %standard-phases
379 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
382 (setenv "PYTEST_DJANGO_TEST_RUNNER" "pytest")
383 (setenv "DJANGO_SETTINGS_MODULE"
384 "pytest_django_test.settings_sqlite_file")
385 (invoke "python" "-m" "pytest" "-vv" "-k"
386 ;; FIXME: these tests fail to locate Django templates ...
387 (string-append "not test_django_not_loaded_without_settings"
388 " and not test_settings"
389 ;; ... and this does not discover
390 ;; 'pytest_django_test'.
391 " and not test_urls_cache_is_cleared")))
392 (format #t "test suite not run~%")))))))
394 (list python-django python-setuptools-scm
396 python-pytest-xdist-next))
398 (list python-pytest))
399 (home-page "https://pytest-django.readthedocs.org/")
400 (synopsis "Django plugin for py.test")
401 (description "Pytest-django is a plugin for py.test that provides a set of
402 useful tools for testing Django applications and projects.")
403 (license license:bsd-3)))
405 (define-public python-django-haystack
407 (name "python-django-haystack")
412 (uri (pypi-uri "django-haystack" version))
415 "10kaa5641cakpra2x3jqgys085gdkjcyns26plfyrmfpjmmpa1bd"))))
416 (build-system python-build-system)
419 (modify-phases %standard-phases
420 (add-after 'unpack 'loosen-verion-restrictions
422 (substitute* "setup.py"
423 (("geopy.*") "geopy\",\n"))))
424 (add-before 'check 'set-gdal-lib-path
425 (lambda* (#:key inputs #:allow-other-keys)
426 (setenv "GDAL_LIBRARY_PATH"
427 (string-append (assoc-ref inputs "gdal")
429 ;; Importing this module requires setting up a Django project.
430 (delete 'sanity-check))
431 #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file
433 (list python-django))
442 python-setuptools-scm
445 (home-page "http://haystacksearch.org/")
446 (synopsis "Pluggable search for Django")
447 (description "Haystack provides modular search for Django. It features a
448 unified, familiar API that allows you to plug in different search backends
449 (such as Solr, Elasticsearch, Whoosh, Xapian, etc.) without having to modify
451 (license license:bsd-3)))
453 (define-public python-django-filter
455 (name "python-django-filter")
459 (uri (pypi-uri "django-filter" version))
462 "1bz5qzdk9pk4a2lp2yacrdnqmkv24vxnz4k3lykrnpc3b7bkvrhi"))))
463 (build-system python-build-system)
466 (modify-phases %standard-phases
469 (invoke "python" "runtests.py"))))))
471 (list python-django python-django-rest-framework
472 python-django-crispy-forms python-mock))
473 (home-page "https://django-filter.readthedocs.io/en/latest/")
474 (synopsis "Reusable Django application to filter querysets dynamically")
476 "Django-filter is a generic, reusable application to alleviate writing
477 some of the more mundane bits of view code. Specifically, it allows users to
478 filter down a queryset based on a model’s fields, displaying the form to let
480 (license license:bsd-3)))
482 (define-public python-django-allauth
484 (name "python-django-allauth")
489 (uri (pypi-uri "django-allauth" version))
492 "0c0x8izvrnjhrr48w6pwsfk9ddbi6yfxg7v3hh5dm1vz1d0hjwpi"))))
493 (build-system python-build-system)
496 (modify-phases %standard-phases
499 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
500 (invoke "django-admin" "test" "allauth.tests"
501 "--pythonpath=."))))))
503 (list python-openid python-requests python-requests-oauthlib))
507 (list python-django))
508 (home-page "https://github.com/pennersr/django-allauth")
509 (synopsis "Set of Django applications addressing authentication")
511 "Integrated set of Django applications addressing authentication,
512 registration, account management as well as 3rd party (social)
513 account authentication.")
514 (license license:expat)))
516 (define-public python-django-debug-toolbar
518 (name "python-django-debug-toolbar")
524 (url "https://github.com/jazzband/django-debug-toolbar")
526 (file-name (git-file-name name version))
529 "1m1j2sx7q0blma0miswj3c8hrfi5q4y5cq2b816v8gagy89xgc57"))))
530 (build-system python-build-system)
532 (list python-sqlparse python-django))
534 (list python-django-jinja python-html5lib))
537 (modify-phases %standard-phases
540 (invoke "make" "test"))))))
542 "https://github.com/jazzband/django-debug-toolbar")
543 (synopsis "Toolbar to help with developing Django applications")
545 "A configurable set of panels that display information about the current
546 request and response as a toolbar on the rendered page.")
547 (license license:bsd-3)))
549 (define-public python-django-debug-toolbar-alchemy
551 (name "python-django-debug-toolbar-alchemy")
553 (home-page "https://github.com/miki725/django-debug-toolbar-alchemy")
556 (uri (pypi-uri "django-debug-toolbar-alchemy" version))
559 "1kmpzghnsc247bc1dl22s4y62k9ijgy1pjms227018h5a4frsa5b"))))
560 (build-system python-build-system)
561 (arguments '(#:tests? #f)) ;XXX: 'make check' does "echo TODO"
563 (list python-django python-django-debug-toolbar python-jsonplus
564 python-six python-sqlalchemy))
565 (synopsis "Django Debug Toolbar panel for SQLAlchemy")
567 "This package completely mimics the default Django Debug Toolbar SQL
568 panel (internally it is actually subclassed), but instead of displaying
569 queries done via the Django ORM, SQLAlchemy generated queries are displayed.")
570 (license license:expat)))
572 (define-public python-django-gravatar2
574 (name "python-django-gravatar2")
579 (uri (pypi-uri "django-gravatar2" version))
582 "1vn921fb6jjx7rf5dzhy66rkb71nwmh9ydd0xs9ys72icw4jh4y8"))))
583 (build-system python-build-system)
585 '(;; TODO: The django project for the tests is missing from the release.
588 (list python-django))
589 (home-page "https://github.com/twaddington/django-gravatar")
590 (synopsis "Gravatar support for Django, improved version")
592 "Essential Gravatar support for Django. Features helper methods,
593 templatetags and a full test suite.")
594 (license license:expat)))
596 (define-public python-django-assets
598 (name "python-django-assets")
602 (uri (pypi-uri "django-assets" version))
605 "0fc6i77faxxv1gjlp06lv3kw64b5bhdiypaygfxh5djddgk83fwa"))))
606 (build-system python-build-system)
610 (list python-django python-webassets))
611 (home-page "https://github.com/miracle2k/django-assets")
612 (synopsis "Asset management for Django")
614 "Asset management for Django, to compress and merge CSS and Javascript
615 files. Integrates the webassets library with Django, adding support for
616 merging, minifying and compiling CSS and Javascript files.")
617 (license license:bsd-2)))
619 (define-public python-django-jinja
621 (name "python-django-jinja")
627 (url "https://github.com/niwinz/django-jinja")
629 (file-name (git-file-name name version))
632 "0p9pkn6jjzagpnvcrl9c2vjqamkms7ymvyhhmaqqqhrlv89qnzp7"))))
633 (build-system python-build-system)
635 (list python-django python-jinja2 python-pytz python-django-pipeline))
637 '(;; TODO Tests currently fail due to issues with the configuration for
641 (modify-phases %standard-phases
643 (lambda* (#:key tests? #:allow-other-keys)
646 (with-directory-excursion "testing"
647 (invoke "python" "runtests.py"))))))))
649 "https://niwinz.github.io/django-jinja/latest/")
650 (synopsis "Simple jinja2 templating backend for Django")
652 "This package provides a templating backend for Django, using Jinja2. It
653 provides certain advantages over the builtin Jinja2 backend in Django, for
654 example, explicit calls to callables from templates and better performance.")
655 (license license:bsd-3)))
657 (define-public python-dj-database-url
659 (name "python-dj-database-url")
663 (uri (pypi-uri "dj-database-url" version))
666 "0qs16g5y3lflxibsl8gwkwap21crhmmv98l60rdq6x1wawgypsja"))))
667 (build-system python-build-system)
668 (home-page "https://github.com/kennethreitz/dj-database-url")
669 (synopsis "Use Database URLs in your Django Application")
671 "This simple Django utility allows you to utilize the 12factor inspired
672 DATABASE_URL environment variable to configure your Django application.
674 The dj_database_url.config method returns a Django database connection
675 dictionary, populated with all the data specified in your URL. There is also a
676 conn_max_age argument to easily enable Django’s connection pool.")
677 (license license:bsd-2)))
679 (define-public python-django-picklefield
681 (name "python-django-picklefield")
683 (home-page "https://github.com/gintas/django-picklefield")
684 ;; Use a git checkout because the PyPI release lacks tests.
690 (commit (string-append "v" version))))
691 (file-name (git-file-name name version))
694 "0ni7bc86k0ra4pc8zv451pzlpkhs1nyil1sq9jdb4m2mib87b5fk"))))
695 (build-system python-build-system)
697 '(#:phases (modify-phases %standard-phases
700 (invoke "python" "-m" "django" "test" "-v2"
701 "--settings=tests.settings"))))))
703 ;; XXX: Picklefield has not been updated in 10+ years and fails tests
705 `(("python-django@2.2" ,python-django-2.2)))
706 (synopsis "Pickled object field for Django")
707 (description "Pickled object field for Django")
708 (license license:expat)))
710 (define-public python-django-bulk-update
712 (name "python-django-bulk-update")
716 (uri (pypi-uri "django-bulk-update" version))
719 "0dxkmrm3skyw82i0qa8vklxw1ma1y308kh9w2hcnvhpacn5cxdss"))))
720 (build-system python-build-system)
722 ;; XXX: Tests require a Postgres database.
725 (list python-django))
726 (home-page "https://github.com/aykut/django-bulk-update")
727 (synopsis "Simple bulk update over Django ORM or with helper function")
729 "Simple bulk update over Django ORM or with helper function. This
730 project aims to bulk update given objects using one query over Django ORM.")
731 (license license:expat)))
733 (define-public python-django-contact-form
735 (name "python-django-contact-form")
739 (uri (pypi-uri "django-contact-form" version))
742 "1my9hkrylckp5vfqg9b0kncrdlxjnwxll56sdciqn4v19i4wbq1y"))))
743 (build-system python-build-system)
746 (modify-phases %standard-phases
749 (invoke "coverage" "run" "--source" "contact_form"
752 (list python-coverage))
754 (list python-django))
755 (home-page "https://github.com/ubernostrum/django-contact-form")
756 (synopsis "Contact form for Django")
758 "This application provides simple, extensible contact-form functionality
760 (license license:bsd-3)))
762 (define-public python-django-contrib-comments
764 (name "python-django-contrib-comments")
768 (uri (pypi-uri "django-contrib-comments" version))
771 "0ccdiv784a5vnpfal36km4dyg12340rwhpr0riyy0k89wfnjn8yi"))))
772 (build-system python-build-system)
774 (list python-django python-six))
775 (home-page "https://github.com/django/django-contrib-comments")
776 (synopsis "Comments framework")
778 "Django used to include a comments framework; since Django 1.6 it's been
779 separated to a separate project. This is that project. This framework can be
780 used to attach comments to any model, so you can use it for comments on blog
781 entries, photos, book chapters, or anything else.")
782 (license license:bsd-3)))
784 (define-public python-django-pipeline
786 (name "python-django-pipeline")
791 (uri (pypi-uri "django-pipeline" version))
794 "19vrbd5s12qw4qlg5n8ldv7zz2rs5y2sdid1i7lvgp92m71dayvc"))))
795 (build-system python-build-system)
798 (modify-phases %standard-phases
799 (add-after 'unpack 'patch-source
801 (substitute* "tests/tests/test_compiler.py"
802 (("\\/usr\\/bin\\/env")
805 (lambda*(#:key tests? #:allow-other-keys)
807 (setenv "DJANGO_SETTINGS_MODULE" "tests.settings")
808 (invoke "django-admin" "test" "tests"
809 "--pythonpath=.")))))))
811 (list python-css-html-js-minify python-django python-slimit
814 "https://github.com/jazzband/django-pipeline")
815 (synopsis "Asset packaging library for Django")
817 "Pipeline is an asset packaging library for Django, providing both CSS
818 and JavaScript concatenation and compression, built-in JavaScript template
819 support, and optional data-URI image and font embedding.")
820 (license license:expat)))
822 (define-public python-django-redis
824 (name "python-django-redis")
828 (uri (pypi-uri "django-redis" version))
831 "0qvsm8yjchl0d3i7g20wba6px9lb5gv8kp3fcnr6hr0y0b3qjr9h"))))
832 (build-system python-build-system)
835 (modify-phases %standard-phases
838 (invoke "redis-server" "--daemonize" "yes")
839 (with-directory-excursion "tests"
840 (invoke "python" "runtests.py")))))))
842 (list python-fakeredis python-hiredis python-mock python-msgpack
845 (list python-django python-redis))
846 (home-page "https://github.com/niwibe/django-redis")
847 (synopsis "Full featured redis cache backend for Django")
849 "Full featured redis cache backend for Django.")
850 (license license:bsd-3)))
852 (define-public python-django-rq
854 (name "python-django-rq")
858 (uri (pypi-uri "django-rq" version))
861 "0lksnjn3q3f7y72bj2yr8870w28a5b6x0vjnd9nhpq2ah6xfz6pf"))))
862 (build-system python-build-system)
865 (modify-phases %standard-phases
868 (invoke "redis-server" "--daemonize" "yes")
869 (invoke "django-admin.py" "test" "django_rq"
870 "--settings=django_rq.tests.settings"
871 "--pythonpath=."))))))
873 (list python-django-redis python-mock python-rq-scheduler redis))
875 (list python-django python-rq))
876 (home-page "https://github.com/ui/django-rq")
877 (synopsis "Django integration with RQ")
879 "Django integration with RQ, a Redis based Python queuing library.
880 Django-RQ is a simple app that allows you to configure your queues in django's
881 settings.py and easily use them in your project.")
882 (license license:expat)))
884 (define-public python-django-q
886 (name "python-django-q")
891 (uri (pypi-uri "django-q" version))
893 (base32 "03z1pf6wlf47i7afr79a8fiiidfk1vq19yaqnv0m4qdny7f58gaj"))))
894 (build-system python-build-system)
895 ;; FIXME: Tests require disque, Redis, MongoDB, Docker.
896 (arguments '(#:tests? #f))
898 (list python-arrow python-blessed python-django
899 python-django-picklefield))
900 (home-page "https://django-q.readthedocs.io/")
901 (synopsis "Multiprocessing distributed task queue for Django")
903 "Django Q is a native Django task queue, scheduler and worker application
904 using Python multiprocessing.")
905 (license license:expat)))
907 (define-public python-django-sortedm2m
909 (name "python-django-sortedm2m")
913 (uri (pypi-uri "django-sortedm2m" version))
916 "0z0yymmrr2l5cznqbzwziw624df0qsiflvbpqwrpan52nww3dk4a"))))
917 (build-system python-build-system)
919 `(#:phases (modify-phases %standard-phases
922 (invoke "django-admin"
923 "test" "--settings=test_project.settings"
924 "--pythonpath=."))))))
926 (list python-django))
927 (home-page "https://github.com/jazzband/django-sortedm2m")
928 (synopsis "Drop-in replacement for django's own ManyToManyField")
930 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
931 The provided SortedManyToManyField behaves like the original one but remembers
932 the order of added relations.")
933 (license license:bsd-3)))
935 (define-public python-django-appconf
937 (name "python-django-appconf")
941 (uri (pypi-uri "django-appconf" version))
944 "101k8nkc7xlffpjdi2qbrp9pc4v8hzvmkzi12qp7vms39asxwn5y"))))
945 (build-system python-build-system)
947 '(#:phases (modify-phases %standard-phases
950 (setenv "DJANGO_SETTINGS_MODULE" "tests.test_settings")
951 (invoke "django-admin" "test" "--pythonpath=."))))))
953 (list python-django))
954 (home-page "https://github.com/django-compressor/django-appconf")
955 (synopsis "Handle configuration defaults of packaged Django apps")
957 "This app precedes Django's own AppConfig classes that act as \"objects
958 [to] store metadata for an application\" inside Django's app loading mechanism.
959 In other words, they solve a related but different use case than
960 django-appconf and can't easily be used as a replacement. The similarity in
961 name is purely coincidental.")
962 (license license:bsd-3)))
964 (define-public python-django-statici18n
966 (name "python-django-statici18n")
968 (home-page "https://github.com/zyegfryed/django-statici18n")
973 (commit (string-append "v" version))))
974 (file-name (git-file-name name version))
977 "0x0xvfqd40is2ks43d65awgqkx3wk10lvdim15scvbjhkh301b6v"))))
978 (build-system python-build-system)
980 '(#:phases (modify-phases %standard-phases
983 (setenv "PYTHONPATH" "./tests/test_project")
984 (setenv "DJANGO_SETTINGS_MODULE" "project.settings")
985 (invoke "pytest" "-vv"))))))
987 (list python-pytest python-pytest-django))
989 `(("python-django" ,python-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 (list 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-django-rest-framework
1027 (name "python-django-rest-framework")
1033 (url "https://github.com/encode/django-rest-framework")
1035 (file-name (git-file-name name version))
1038 "11wfb156yin6mlgcdzfmi267jsq1cld131mxgd13aqsrj06zlray"))))
1039 (build-system python-build-system)
1042 (modify-phases %standard-phases
1044 (lambda* (#:key tests? inputs #:allow-other-keys)
1046 (invoke "python" "runtests.py")
1047 (format #t "test suite not run~%")))))))
1049 (list python-pytest python-pytest-django tzdata-for-tests))
1051 (list python-django python-pytz))
1052 (home-page "https://www.django-rest-framework.org")
1053 (synopsis "Toolkit for building Web APIs with Django")
1055 "The Django REST framework is for building Web APIs with Django. It
1056 provides features like a Web-browsable API and authentication policies.")
1057 (license license:bsd-2)))
1059 (define-public python-djangorestframework
1060 (deprecated-package "python-djangorestframework" python-django-rest-framework))
1062 (define-public python-django-sekizai
1064 (name "python-django-sekizai")
1069 (uri (pypi-uri "django-sekizai" version))
1072 "0vrkli625b5s1wldri3dyrfvqbxg7zxy2pg0rpjixw3b1ndz0ag8"))))
1073 (build-system python-build-system)
1074 (arguments '(#:tests? #f)) ; Tests not included with release.
1076 (list python-django python-django-classy-tags python-six))
1077 (home-page "https://github.com/divio/django-sekizai")
1078 (synopsis "Template blocks for Django projects")
1079 (description "Sekizai means blocks in Japanese, and that is what this app
1080 provides. A fresh look at blocks. With @code{django-sekizai} you can define
1081 placeholders where your blocks get rendered and at different places in your
1082 templates append to those blocks. This is especially useful for css and
1083 javascript. Your subtemplates can now define css and javscript files to be
1084 included, and the css will be nicely put at the top and the javascript to the
1085 bottom, just like you should. Also sekizai will ignore any duplicate content in
1087 (license license:bsd-3)))
1089 (define-public python-django-crispy-forms
1091 (name "python-django-crispy-forms")
1096 (uri (pypi-uri "django-crispy-forms" version))
1099 "0fxlf233f49hjax786p4r650rd0ilvhnpyvw8hv1d1aqnkxy1wgj"))))
1100 (build-system python-build-system)
1102 '(;; No included tests
1105 (list python-django))
1107 "http://github.com/maraujop/django-crispy-forms")
1108 (synopsis "Tool to control Django forms without custom templates")
1110 "@code{django-crispy-forms} lets you easily build, customize and reuse
1111 forms using your favorite CSS framework, without writing template code.")
1112 (license license:expat)))
1114 (define-public python-django-compressor
1116 (name "python-django-compressor")
1121 (uri (pypi-uri "django_compressor" version))
1123 (base32 "1q0m0hfg7sqmj5km924g4dgy3nx51aszzsprlp6gsin10mv0fn1k"))))
1124 (build-system python-build-system)
1127 (modify-phases %standard-phases
1129 (lambda* (#:key tests? #:allow-other-keys)
1132 (setenv "DJANGO_SETTINGS_MODULE" "compressor.test_settings")
1133 (invoke "django-admin" "test"
1136 ;; Tests fail with beautifulsoup 4.9+
1137 ;; https://github.com/django-compressor/django-compressor/issues/998
1140 (list python-django-appconf python-rcssmin python-rjsmin))
1142 (list python-beautifulsoup4 python-brotli python-csscompressor
1143 python-django-sekizai python-mock))
1144 (home-page "https://django-compressor.readthedocs.io/en/latest/")
1146 "Compress linked and inline JavaScript or CSS into single cached files")
1148 "Django Compressor combines and compresses linked and inline Javascript or
1149 CSS in a Django templates into cacheable static files by using the compress
1151 (license license:expat)))
1153 (define-public python-django-override-storage
1155 (name "python-django-override-storage")
1157 (home-page "https://github.com/danifus/django-override-storage")
1163 (commit (string-append "v" version))))
1164 (file-name (git-file-name name version))
1166 (base32 "081kzfk7mmybhihvc92d3hsdg0r2k20ydq88fs1fgd348sq1ax51"))))
1167 (build-system python-build-system)
1169 '(#:phases (modify-phases %standard-phases
1172 (invoke "python" "runtests.py"))))))
1176 (list python-django))
1177 (synopsis "Django test helpers to manage file storage side effects")
1179 "This project provides tools to help reduce the side effects of using
1180 FileFields during tests.")
1181 (license license:expat)))
1183 (define-public python-django-auth-ldap
1185 (name "python-django-auth-ldap")
1189 (uri (pypi-uri "django-auth-ldap" version))
1192 "0fajn4bk7m1hk0mjz97q7vlfzh7ibzv8f4qn7zhkq26f4kk7jvr7"))))
1193 (build-system python-build-system)
1196 #~(modify-phases %standard-phases
1199 ;; Set file modification times to the early 80's because
1200 ;; the Zip format does not support earlier timestamps.
1201 (setenv "SOURCE_DATE_EPOCH"
1202 (number->string (* 10 366 24 60 60)))
1203 (invoke "python" "-m" "build" "--wheel"
1204 "--no-isolation" ".")))
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (setenv "SLAPD" (search-input-file inputs "/libexec/slapd"))
1209 (search-input-directory inputs "etc/openldap/schema"))
1210 (invoke "python" "-m" "django" "test"
1211 "--settings" "tests.settings")))
1214 (let ((whl (car (find-files "dist" "\\.whl$"))))
1215 (invoke "pip" "--no-cache-dir" "--no-input"
1216 "install" "--no-deps" "--prefix" #$output whl)))))))
1218 (list openldap-2.6 python-wheel python-setuptools-scm python-toml
1220 ;; These can be removed after <https://bugs.gnu.org/46848>.
1221 python-pypa-build python-pip))
1223 (list python-django python-ldap))
1224 (home-page "https://github.com/django-auth-ldap/django-auth-ldap")
1225 (synopsis "Django LDAP authentication backend")
1227 "This package provides an LDAP authentication backend for Django.")
1228 (license license:bsd-2)))
1230 (define-public python-django-logging-json
1232 (name "python-django-logging-json")
1236 (uri (pypi-uri "django-logging-json" version))
1239 "06041a8icazzp73kg93c7k1ska12wvkq7fpcad0l0sm1qnxx5yx7"))))
1240 (build-system python-build-system)
1242 '(#:tests? #f ;no tests
1243 #:phases (modify-phases %standard-phases
1244 ;; Importing this module requires a Django project.
1245 (delete 'sanity-check))))
1247 (list python-certifi python-django python-elasticsearch python-six))
1248 (home-page "https://github.com/cipriantarta/django-logging")
1249 (synopsis "Log requests/responses in various formats")
1251 "This package provides a Django library that logs request, response,
1252 and exception details in a JSON document. It can also send logs directly
1254 (license license:bsd-2)))
1256 (define-public python-django-netfields
1258 (name "python-django-netfields")
1262 (uri (pypi-uri "django-netfields" version))
1265 "0jwlbyaxk91fq69g2y0zpfjgmjgh6l0lqm5mhys7m5968lkihvgp"))))
1266 (build-system python-build-system)
1267 (arguments '(#:tests? #f)) ;XXX: Requires a running PostgreSQL server
1269 (list python-django python-netaddr python-psycopg2 python-six))
1270 (home-page "https://github.com/jimfunk/django-postgresql-netfields")
1271 (synopsis "PostgreSQL netfields implementation for Django")
1273 "This package provides mappings for the PostgreSQL @code{INET} and
1274 @code{CIDR} fields for use in Django projects.")
1275 (license license:bsd-3)))
1277 (define-public python-django-url-filter
1279 (name "python-django-url-filter")
1281 (home-page "https://github.com/miki725/django-url-filter")
1284 (uri (git-reference (url home-page) (commit version)))
1285 (file-name (git-file-name name version))
1288 "0r4zhqhs8y6cnplwyvcb0zpijizw1ifnszs38n4w8138657f9026"))
1289 (modules '((guix build utils)))
1291 ;; Patch for Django 4.0 compatibility, taken from upstream pull
1292 ;; request: https://github.com/miki725/django-url-filter/pull/103
1293 '(substitute* "url_filter/validators.py"
1294 ((" ungettext_lazy")
1295 " ngettext_lazy")))))
1296 (build-system python-build-system)
1298 '(#:tests? #f ;FIXME: Django raises "Apps aren't loaded yet"!?
1299 #:phases (modify-phases %standard-phases
1300 (add-after 'unpack 'loosen-requirements
1302 ;; Do not depend on compatibility package for old
1304 (substitute* "requirements.txt"
1305 (("enum-compat") ""))))
1307 (lambda* (#:key tests? #:allow-other-keys)
1310 (setenv "DJANGO_SETTINGS_MODULE"
1311 "test_project.settings")
1312 (invoke "pytest" "-vv" "--doctest-modules"
1313 "tests/" "url_filter/"))
1314 (format #t "test suite not run~%")))))))
1316 (list python-cached-property python-django python-six))
1317 (synopsis "Filter data via human-friendly URLs")
1319 "The main goal of Django URL Filter is to provide an easy URL interface
1320 for filtering data. It allows the user to safely filter by model attributes
1321 and also specify the lookup type for each filter (very much like
1322 Django's filtering system in ORM).")
1323 (license license:expat)))
1325 (define-public python-django-svg-image-form-field
1327 (name "python-django-svg-image-form-field")
1333 (url "https://github.com/artrey/django-svg-image-form-field")
1334 (commit (string-append version))))
1335 (file-name (git-file-name name version))
1337 (base32 "131m545khn8l20j4x2bvlvz36dlbnhj9pc98i2dw72s3bw8pgws0"))))
1338 (build-system python-build-system)
1340 (list python-defusedxml python-django python-pillow))
1341 (home-page "https://github.com/artrey/django-svg-image-form-field")
1342 (synopsis "Form field to validate SVG and other images")
1343 (description "This form field allows users to provide SVG images for
1344 models that use Django's standard @code{ImageField}, in addition to the
1345 image files already supported by it.")
1346 (license license:expat)))