1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
5 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages django)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system python)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages databases)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages python)
33 #:use-module (gnu packages python-web)
34 #:use-module (gnu packages time))
36 (define-public python-django
38 (name "python-django")
42 (uri (pypi-uri "Django" version))
45 "1p0fk0dszci9gx76hyhay3n8n0k8r4sznbdcrpd9g2xl15rps1vl"))))
46 (build-system python-build-system)
48 '(#:modules ((srfi srfi-1)
49 (guix build python-build-system)
52 (modify-phases %standard-phases
53 (add-before 'check 'set-tzdir
54 (lambda* (#:key inputs #:allow-other-keys)
55 ;; The test-suite tests timezone-dependent functions, thus tzdata
56 ;; needs to be available.
58 (string-append (assoc-ref inputs "tzdata")
62 (lambda* (#:key inputs #:allow-other-keys)
64 (string-append ".:" (getenv "PYTHONPATH")))
65 (substitute* "tests/admin_scripts/tests.py"
66 (("python_path = \\[")
67 (string-append "python_path = ['"
70 (assoc-ref inputs "python-pytz")
72 (string-split (getenv "PYTHONPATH")
75 (zero? (system* "python" "tests/runtests.py")))))))
76 ;; TODO: Install extras/django_bash_completion.
78 `(("tzdata", tzdata-for-tests)
79 ;; bcrypt and argon2-cffi are extra requirements not yet in guix
80 ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0
81 ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt!
82 ;; Remaining packages are test requirements taken from
83 ;; tests/requirements/py3.txt
84 ("python-docutils" ,python-docutils)
85 ;; optional for tests: ("python-geoip2" ,python-geoip2)
86 ("python-jinja2" ,python-jinja2) ; >= 2.7
87 ;; optional for tests: ("python-memcached" ,python-memcached)
88 ("python-numpy" ,python-numpy)
89 ("python-pillow" ,python-pillow)
90 ("python-pyyaml" ,python-pyyaml)
91 ;; optional for tests: ("python-selenium" ,python-selenium)
92 ("python-sqlparse" ,python-sqlparse)
93 ("python-tblib" ,python-tblib)))
95 `(("python-pytz" ,python-pytz)))
96 (home-page "http://www.djangoproject.com/")
97 (synopsis "High-level Python Web framework")
99 "Django is a high-level Python Web framework that encourages rapid
100 development and clean, pragmatic design. It provides many tools for building
101 any Web site. Django focuses on automating as much as possible and adhering
102 to the @dfn{don't repeat yourself} (DRY) principle.")
103 (license license:bsd-3)
104 (properties `((python2-variant . ,(delay python2-django))
105 (cpe-name . "django")))))
107 (define-public python2-django
108 (let ((base (package-with-python2 (strip-python2-variant python-django))))
112 `(;; Test requirements for Python 2 taken from
113 ;; tests/requirements/py3.txt: enum34 and mock.
114 ("python2-enum34" ,python2-enum34)
115 ("python2-mock" ,python2-mock)
116 ;; When adding memcached mind: for Python 2 memcached <= 1.53 is
118 ,@(package-native-inputs base))))))
120 (define-public python-django-simple-math-captcha
122 (name "python-django-simple-math-captcha")
126 (uri (pypi-uri "django-simple-math-captcha" version))
129 "0906hms6y6znjhpd0g4wmzv9vcla4brkdpsm4zha9zdj8g5vq2hd"))))
130 (build-system python-build-system)
132 ;; FIXME: Upstream uses a 'runtests.py' script that is not
133 ;; present in the pypi tarball.
136 `(("python-django" ,python-django)))
137 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
138 (synopsis "Easy-to-use math field/widget captcha for Django forms")
140 "A multi-value-field that presents a human answerable question,
141 with no settings.py configuration necessary, but instead can be configured
142 with arguments to the field constructor.")
143 (license license:asl2.0)))
145 (define-public python2-django-simple-math-captcha
146 (package-with-python2 python-django-simple-math-captcha))
148 (define-public python-pytest-django
150 (name "python-pytest-django")
154 (uri (pypi-uri "pytest-django" version))
157 "02932m2sr8x22m4az8syr8g835g4ak77varrnw71n6xakmdcr303"))))
158 (build-system python-build-system)
160 `(#:tests? #f ; FIXME: How to run tests?
162 (modify-phases %standard-phases
163 (add-after 'unpack 'patch-setuppy
165 (substitute* "setup.py"
166 (("setuptools_scm==1.11.1") "setuptools_scm"))
169 `(("python-django" ,python-django)
170 ("python-setuptools-scm" ,python-setuptools-scm)))
172 `(("python-pytest" ,python-pytest)))
173 (home-page "http://pytest-django.readthedocs.org/")
174 (synopsis "Django plugin for py.test")
175 (description "Pytest-django is a plugin for py.test that provides a set of
176 useful tools for testing Django applications and projects.")
177 (license license:bsd-3)))
179 (define-public python2-pytest-django
180 (package-with-python2 python-pytest-django))
182 (define-public python-django-filter
184 (name "python-django-filter")
188 (uri (pypi-uri "django-filter" version))
191 "0f78hmk8c903zwfzlsiw7ivgag81ymmb5hi73rzxbhnlg2v0l3fx"))))
192 (build-system python-build-system)
195 (modify-phases %standard-phases
198 (zero? (system* "python" "runtests.py")))))))
200 `(("python-django" ,python-django)
201 ("python-mock" ,python-mock)))
202 (home-page "https://django-filter.readthedocs.io/en/latest/")
203 (synopsis "Reusable Django application to filter querysets dynamically")
205 "Django-filter is a generic, reusable application to alleviate writing
206 some of the more mundane bits of view code. Specifically, it allows users to
207 filter down a queryset based on a model’s fields, displaying the form to let
209 (license license:bsd-3)))
211 (define-public python2-django-filter
212 (package-with-python2 python-django-filter))
214 (define-public python-django-allauth
216 (name "python-django-allauth")
221 (uri (pypi-uri "django-allauth" version))
224 "1fslqc5qqb0b66yscvkyjwfv8cnbfx5nlkpnwimyb3pf1nc1w7r3"))))
225 (build-system python-build-system)
228 (modify-phases %standard-phases
229 ;; TODO: Tagging the tests requiring the web could be done upstream.
230 (add-before 'check 'skip-test-requiring-network-access
232 (substitute* "allauth/socialaccount/providers/openid/tests.py"
234 "from django.test import tag
239 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
245 "--exclude-tag=requires-web")))))))
247 `(("python-openid" ,python-openid)
248 ("python-requests" ,python-requests)
249 ("python-requests-oauthlib" ,python-requests-oauthlib)))
251 `(("python-mock" ,python-mock)))
253 `(("python-django" ,python-django)))
254 (home-page "https://github.com/pennersr/django-allauth")
255 (synopsis "Set of Django applications addressing authentication")
257 "Integrated set of Django applications addressing authentication,
258 registration, account management as well as 3rd party (social)
259 account authentication.")
260 (license license:expat)))
262 (define-public python2-django-allauth
263 (package-with-python2 python-django-allauth))
265 (define-public python-django-gravatar2
267 (name "python-django-gravatar2")
272 (uri (pypi-uri "django-gravatar2" version))
275 "1v4qyj6kms321yw0z2g1kch6b2dskmv6fjd6sfxzwr4xshq9mccl"))))
276 (build-system python-build-system)
278 `(("python-django" ,python-django)))
279 (home-page "https://github.com/twaddington/django-gravatar")
280 (synopsis "Gravatar support for Django, improved version")
282 "Essential Gravatar support for Django. Features helper methods,
283 templatetags and a full test suite.")
284 (license license:expat)))
286 (define-public python2-django-gravatar2
287 (package-with-python2 python-django-gravatar2))
289 (define-public python-django-assets
291 (name "python-django-assets")
295 (uri (pypi-uri "django-assets" version))
298 "0y0007fvkn1rdlj2g0y6k1cnkx53kxab3g8i85i0rd58k335p365"))))
299 (build-system python-build-system)
302 (modify-phases %standard-phases
303 (add-before 'check 'fix-tests
306 ;; https://github.com/miracle2k/django-assets/issues/87
307 (substitute* "tests/__init__.py"
308 (("settings.configure.*")
310 "settings.configure(\n"
311 "INSTALLED_APPS=['django_assets', "
312 "'django.contrib.staticfiles'],\n"
313 "TEMPLATES=[{'BACKEND': "
314 "'django.template.backends.django.DjangoTemplates'}],\n"
317 (substitute* "tests/test_django.py"
318 (("TestLoader") "NoTestLoader"))))))))
320 `(("python-nose" ,python-nose)))
322 `(("python-django" ,python-django)
323 ("python-webassets" ,python-webassets)))
324 (home-page "https://github.com/miracle2k/django-assets")
325 (synopsis "Asset management for Django")
327 "Asset management for Django, to compress and merge CSS and Javascript
328 files. Integrates the webassets library with Django, adding support for
329 merging, minifying and compiling CSS and Javascript files.")
330 (license license:bsd-2)))
332 (define-public python2-django-assets
333 (package-with-python2 python-django-assets))
335 (define-public python-django-jsonfield
337 (name "python-django-jsonfield")
341 (uri (pypi-uri "jsonfield" version))
344 "19x4lak0hg9c20r7mvf27w7i8r6i4sg2g0ypmlmp2665fnk76zvy"))))
345 (build-system python-build-system)
348 (modify-phases %standard-phases
349 (add-before 'check 'fix-tests
351 (substitute* "jsonfield/tests.py"
352 (("django.forms.util") "django.forms.utils")))))))
354 `(("python-django" ,python-django)))
355 (home-page "https://github.com/bradjasper/django-jsonfield")
356 (synopsis "Store validated JSON in your model")
358 "Django-jsonfield is a reusable Django field that allows you to store
359 validated JSON in your model. It silently takes care of serialization. To
360 use, simply add the field to one of your models.")
361 (license license:expat)))
363 (define-public python2-django-jsonfield
364 (package-with-python2 python-django-jsonfield))
366 (define-public python-dj-database-url
368 (name "python-dj-database-url")
372 (uri (pypi-uri "dj-database-url" version))
375 "024zbkc5rli4hia9lz9g8kf1zxhb2gwawj5abf67i7gf8n22v0x6"))))
376 (build-system python-build-system)
377 (home-page "https://github.com/kennethreitz/dj-database-url")
378 (synopsis "Use Database URLs in your Django Application")
380 "This simple Django utility allows you to utilize the 12factor inspired
381 DATABASE_URL environment variable to configure your Django application.
383 The dj_database_url.config method returns a Django database connection
384 dictionary, populated with all the data specified in your URL. There is also a
385 conn_max_age argument to easily enable Django’s connection pool.")
386 (license license:bsd-2)))
388 (define-public python2-dj-database-url
389 (package-with-python2 python-dj-database-url))
391 (define-public python-django-bulk-update
393 (name "python-django-bulk-update")
397 (uri (pypi-uri "django-bulk-update" version))
400 "0mbng9m7swfc0dnidipbzlxfhlfjrv755dlnha5s4m9mgdxb1fhc"))))
401 (build-system python-build-system)
403 ;; tests don't support django 1.10, but the module seems to work.
406 `(("six" ,python-six)
407 ("jsonfield" ,python-django-jsonfield)
408 ("python-dj-database-url" ,python-dj-database-url)))
410 `(("python-django" ,python-django)))
411 (home-page "https://github.com/aykut/django-bulk-update")
412 (synopsis "Simple bulk update over Django ORM or with helper function")
414 "Simple bulk update over Django ORM or with helper function. This
415 project aims to bulk update given objects using one query over Django ORM.")
416 (license license:expat)))
418 (define-public python2-django-bulk-update
419 (package-with-python2 python-django-bulk-update))
421 (define-public python-django-contact-form
423 (name "python-django-contact-form")
427 (uri (pypi-uri "django-contact-form" version))
430 "0az590y56k5ahv4sixrkn54d3a8ig2q2z9pl6s3m4f533mx2gj17"))))
431 (build-system python-build-system)
434 (modify-phases %standard-phases
437 ;; the next version will need "make test"
438 (and (zero? (system* "flake8" "contact_form"))
439 (zero? (system* "coverage" "run" "contact_form/runtests.py"))
440 (zero? (system* "coverage" "report" "-m" "--fail-under" "0"))))))))
442 `(("python-coverage" ,python-coverage)
443 ("python-flake8" ,python-flake8)))
445 `(("python-django" ,python-django)))
446 (home-page "https://github.com/ubernostrum/django-contact-form")
447 (synopsis "Contact form for Django")
449 "This application provides simple, extensible contact-form functionality
451 (license license:bsd-3)))
453 (define-public python2-django-contact-form
454 (package-with-python2 python-django-contact-form))
456 (define-public python-django-contrib-comments
458 (name "python-django-contrib-comments")
462 (uri (pypi-uri "django-contrib-comments" version))
465 "0bxsgw8jrkhg6r5s0z6ksfi4w8yknaqb1s9acmxd9pm3pnsnp5kx"))))
466 (build-system python-build-system)
468 `(("python-django" ,python-django)))
469 (home-page "https://github.com/django/django-contrib-comments")
470 (synopsis "Comments framework")
472 "Django used to include a comments framework; since Django 1.6 it's been
473 separated to a separate project. This is that project. This framework can be
474 used to attach comments to any model, so you can use it for comments on blog
475 entries, photos, book chapters, or anything else.")
476 (license license:bsd-3)))
478 (define-public python2-django-contrib-comments
479 (package-with-python2 python-django-contrib-comments))
481 (define-public python-django-overextends
483 (name "python-django-overextends")
487 (uri (pypi-uri "django-overextends" version))
490 "0qc2pcf3i56pmfxh2jw7k3pgljd8xzficmkl2541n7bkcbngqfzm"))))
491 (build-system python-build-system)
494 (modify-phases %standard-phases
497 (zero? (system* "./test_project/manage.py" "test")))))))
499 `(("python-django" ,python-django)))
501 `(("sphinx-me" ,python-sphinx-me)))
502 (home-page "https://github.com/stephenmcd/django-overextends")
503 (synopsis "Circular template inheritance")
505 "A Django reusable app providing the overextends template tag, a drop-in
506 replacement for Django's extends tag, which allows you to use circular template
507 inheritance. The primary use-case for overextends is to simultaneously
508 override and extend templates from other reusable apps, in your own Django
510 (license license:bsd-2)))
512 (define-public python2-django-overextends
513 (package-with-python2 python-django-overextends))
515 (define-public python-django-redis
517 (name "python-django-redis")
521 (uri (pypi-uri "django-redis" version))
524 "0yyyxv8n9l9dhs893jsqwg2cxqkkc79g719n9dzzzqgkzialv1c1"))))
525 (build-system python-build-system)
528 (modify-phases %standard-phases
531 (and (zero? (system* "redis-server" "--daemonize" "yes"))
532 (with-directory-excursion "tests"
533 (zero? (system* "python" "runtests.py")))))))))
535 `(("python-fakeredis" ,python-fakeredis)
536 ("python-hiredis" ,python-hiredis)
537 ("python-mock" ,python-mock)
538 ("python-msgpack" ,python-msgpack)
541 `(("python-django" ,python-django)
542 ("python-redis" ,python-redis)))
543 (home-page "https://github.com/niwibe/django-redis")
544 (synopsis "Full featured redis cache backend for Django")
546 "Full featured redis cache backend for Django.")
547 (license license:bsd-3)))
549 (define-public python2-django-redis
550 (package-with-python2 python-django-redis))
552 (define-public python-django-rq
554 (name "python-django-rq")
558 (uri (pypi-uri "django-rq" version))
561 "04v8ilfdp10bk31fxgh4cn083gsn5m06342cnpm5d10nd8hc0vky"))))
562 (build-system python-build-system)
565 (modify-phases %standard-phases
568 (and (zero? (system* "redis-server" "--daemonize" "yes"))
569 (zero? (system* "django-admin.py" "test" "django_rq"
570 "--settings=django_rq.test_settings"
571 "--pythonpath="))))))))
575 `(("python-django" ,python-django)
576 ("python-rq" ,python-rq)))
577 (home-page "https://github.com/ui/django-rq")
578 (synopsis "Django integration with RQ")
580 "Django integration with RQ, a Redis based Python queuing library.
581 Django-RQ is a simple app that allows you to configure your queues in django's
582 settings.py and easily use them in your project.")
583 (license license:expat)))
585 (define-public python2-django-rq
586 (package-with-python2 python-django-rq))
588 (define-public python-django-sortedm2m
590 (name "python-django-sortedm2m")
594 (uri (pypi-uri "django-sortedm2m" version))
597 "0axf765i7b3c2s83nlph47asi8s071dhq8l7y382v1pw785s22vi"))))
598 (build-system python-build-system)
603 `(("python-django" ,python-django)))
604 (home-page "https://github.com/gregmuellegger/django-sortedm2m")
605 (synopsis "Drop-in replacement for django's own ManyToManyField")
607 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
608 The provided SortedManyToManyField behaves like the original one but remembers
609 the order of added relations.")
610 (license license:bsd-3)))
612 (define-public python2-django-sortedm2m
613 (package-with-python2 python-django-sortedm2m))
615 (define-public python-django-appconf
617 (name "python-django-appconf")
621 (uri (pypi-uri "django-appconf" version))
624 "0qdjdx35g66xjsc50v0c5h3kg6njs8df33mbjx6j4k1vd3m9lkba"))))
625 (build-system python-build-system)
627 `(("python-django" ,python-django)))
628 (home-page "https://github.com/django-compressor/django-appconf")
629 (synopsis "Handle configuration defaults of packaged Django apps")
631 "This app precedes Django's own AppConfig classes that act as \"objects
632 [to] store metadata for an application\" inside Django's app loading mechanism.
633 In other words, they solve a related but different use case than
634 django-appconf and can't easily be used as a replacement. The similarity in
635 name is purely coincidental.")
636 (license license:bsd-3)))
638 (define-public python2-django-appconf
639 (package-with-python2 python-django-appconf))
641 (define-public python-django-statici18n
643 (name "python-django-statici18n")
647 (uri (pypi-uri "django-statici18n" version))
650 "0alcf4g1nv69njhq5k3qw4mfl2k6dc18bik5nk0g1mnp3m8zyz7k"))))
651 (build-system python-build-system)
653 `(("python-django" ,python-django)
654 ("django-appconf" ,python-django-appconf)))
655 (home-page "https://github.com/zyegfryed/django-statici18n")
656 (synopsis "Generate JavaScript catalog to static files")
658 "A Django app that provides helper for generating JavaScript catalog to
660 (license license:bsd-3)))
662 (define-public python2-django-statici18n
663 (package-with-python2 python-django-statici18n))
665 (define-public pootle
672 (uri (pypi-uri "Pootle" version ".tar.bz2"))
675 "0m6qcpkcy22dk3ad5y2k8851kqg2w6vrkywgy4vabwbacd7r1mvn"))))
676 (build-system python-build-system)
678 `(; pootle supports only python2.
680 ;; tests are not run and fail with "pytest_pootle/data/po/.tmp: No such
681 ;; file or directory". If we create this directory,
682 ;; pytest_pootle/data/po/terminology.po is missing.
685 (modify-phases %standard-phases
686 (add-before 'build 'fix-requirements
688 (substitute* "Pootle.egg-info/requires.txt"
691 (substitute* "requirements/tests.txt"
692 (("==3.0.6") ">=3.0.6"))
693 (substitute* "requirements/base.txt"
695 (("2.0.0") "2.1.0")))))))
697 `(("django-allauth" ,python2-django-allauth)
698 ("django-assets" ,python2-django-assets)
699 ("django-bulk-update" ,python2-django-bulk-update)
700 ("django-contact-form" ,python2-django-contact-form)
701 ("django-contrib-comments" ,python2-django-contrib-comments)
702 ("django-overextends" ,python2-django-overextends)
703 ("django-redis" ,python2-django-redis)
704 ("django-rq" ,python2-django-rq)
705 ("django-sortedm2m" ,python2-django-sortedm2m)
706 ("django-statici18n" ,python2-django-statici18n)
707 ("babel" ,python2-babel)
708 ("cssmin" ,python2-cssmin)
709 ("diff-match-patch" ,python2-diff-match-patch)
710 ("dirsync" ,python2-dirsync)
711 ("elasticsearch" ,python2-elasticsearch)
712 ("jsonfield" ,python2-django-jsonfield)
713 ("lxml" ,python2-lxml)
714 ("dateutil" ,python2-dateutil)
715 ("levenshtein" ,python2-levenshtein)
716 ("mysqlclient" ,python2-mysqlclient)
717 ("psycopg2" ,python2-psycopg2)
718 ("pytz" ,python2-pytz)
720 ("scandir" ,python2-scandir)
721 ("stemming" ,python2-stemming)
722 ("translate-toolkit" ,python2-translate-toolkit)))
724 `(("python2-pytest" ,python2-pytest)
725 ("python2-pytest-django" ,python2-pytest-django)
726 ("python2-pytest-catchlog" ,python2-pytest-catchlog)
727 ("python2-pytest-cov" ,python2-pytest-cov)
728 ("python2-factory-boy" ,python2-factory-boy)))
729 (home-page "http://pootle.translatehouse.org/")
730 (synopsis "Community localization server")
732 "Pootle is an online translation and localization tool. It works to
733 lower the barrier of entry, providing tools to enable teams to work towards
734 higher quality while welcoming newcomers.")
735 (license license:gpl3+)))
737 (define-public python-django-tagging
739 (name "python-django-tagging")
744 (uri (pypi-uri "django-tagging" version))
747 "0s7b4v45j783yaxs7rni10k24san0ya77nqz4s7zdf3jhfpk42r1"))))
748 (build-system python-build-system)
749 (home-page "https://github.com/Fantomas42/django-tagging")
750 (synopsis "Generic tagging application for Django")
751 (description "This package provides a generic tagging application for
752 Django projects, which allows association of a number of tags with any
753 @code{Model} instance and makes retrieval of tags simple.")
754 (license license:bsd-3)))
756 (define-public python2-django-tagging
757 (package-with-python2 python-django-tagging))