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>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages django)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system python)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages python)
32 #:use-module (gnu packages python-web)
33 #:use-module (gnu packages time))
35 (define-public python-django
37 (name "python-django")
41 (uri (pypi-uri "Django" version))
44 "1fwqqh2zbcy9dy0lnvk338s11llnnfz2k56bf84w0wv56ayq7vyl"))))
45 (build-system python-build-system)
48 (modify-phases %standard-phases
49 (add-before 'check 'set-tzdir
50 (lambda* (#:key inputs #:allow-other-keys)
51 ;; The test-suite tests timezone-dependent functions, thus tzdata
52 ;; needs to be available.
54 (string-append (assoc-ref inputs "tzdata")
60 (string-append ".:" (getenv "PYTHONPATH")))
61 (zero? (system* "python" "tests/runtests.py")))))))
62 ;; TODO: Install extras/django_bash_completion.
65 ;; bcrypt and argon2-cffi are extra requirements not yet in guix
66 ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0
67 ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt!
68 ;; Remaining packages are test requirements taken from
69 ;; tests/requirements/py3.txt
70 ("python-docutils" ,python-docutils)
71 ;; optional for tests: ("python-geoip2" ,python-geoip2)
72 ("python-jinja2" ,python-jinja2) ; >= 2.7
73 ;; optional for tests: ("python-memcached" ,python-memcached)
74 ("python-numpy" ,python-numpy)
75 ("python-pillow" ,python-pillow)
76 ("python-pyyaml" ,python-pyyaml)
77 ("python-pytz" ,python-pytz)
78 ;; optional for tests: ("python-selenium" ,python-selenium)
79 ("python-sqlparse" ,python-sqlparse)
80 ("python-tblib" ,python-tblib)))
81 (home-page "http://www.djangoproject.com/")
82 (synopsis "High-level Python Web framework")
84 "Django is a high-level Python Web framework that encourages rapid
85 development and clean, pragmatic design. It provides many tools for building
86 any Web site. Django focuses on automating as much as possible and adhering
87 to the @dfn{don't repeat yourself} (DRY) principle.")
88 (license license:bsd-3)
89 (properties `((python2-variant . ,(delay python2-django))
90 (cpe-name . "django")))))
92 (define-public python2-django
93 (let ((base (package-with-python2 (strip-python2-variant python-django))))
97 `(;; Test requirements for Python 2 taken from
98 ;; tests/requirements/py3.txt: enum34 and mock.
99 ("python2-enum34" ,python2-enum34)
100 ("python2-mock" ,python2-mock)
101 ;; When adding memcached mind: for Python 2 memcached <= 1.53 is
103 ,@(package-native-inputs base))))))
105 (define-public python-django-simple-math-captcha
107 (name "python-django-simple-math-captcha")
111 (uri (pypi-uri "django-simple-math-captcha" version))
114 "0906hms6y6znjhpd0g4wmzv9vcla4brkdpsm4zha9zdj8g5vq2hd"))))
115 (build-system python-build-system)
117 ;; FIXME: Upstream uses a 'runtests.py' script that is not
118 ;; present in the pypi tarball.
121 `(("python-django" ,python-django)))
122 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
123 (synopsis "Easy-to-use math field/widget captcha for Django forms")
125 "A multi-value-field that presents a human answerable question,
126 with no settings.py configuration necessary, but instead can be configured
127 with arguments to the field constructor.")
128 (license license:asl2.0)))
130 (define-public python2-django-simple-math-captcha
131 (package-with-python2 python-django-simple-math-captcha))
133 (define-public python-pytest-django
135 (name "python-pytest-django")
139 (uri (pypi-uri "pytest-django" version))
142 "02932m2sr8x22m4az8syr8g835g4ak77varrnw71n6xakmdcr303"))))
143 (build-system python-build-system)
145 `(#:tests? #f ; FIXME: How to run tests?
147 (modify-phases %standard-phases
148 (add-after 'unpack 'patch-setuppy
150 (substitute* "setup.py"
151 (("setuptools_scm==1.11.1") "setuptools_scm"))
154 `(("python-django" ,python-django)
155 ("python-setuptools-scm" ,python-setuptools-scm)))
157 `(("python-pytest" ,python-pytest)))
158 (home-page "http://pytest-django.readthedocs.org/")
159 (synopsis "Django plugin for py.test")
160 (description "Pytest-django is a plugin for py.test that provides a set of
161 useful tools for testing Django applications and projects.")
162 (license license:bsd-3)))
164 (define-public python2-pytest-django
165 (package-with-python2 python-pytest-django))
167 (define-public python-django-filter
169 (name "python-django-filter")
173 (uri (pypi-uri "django-filter" version))
176 "0f78hmk8c903zwfzlsiw7ivgag81ymmb5hi73rzxbhnlg2v0l3fx"))))
177 (build-system python-build-system)
180 (modify-phases %standard-phases
183 (zero? (system* "python" "runtests.py")))))))
185 `(("python-django" ,python-django)
186 ("python-mock" ,python-mock)))
187 (home-page "https://django-filter.readthedocs.io/en/latest/")
188 (synopsis "Reusable Django application to filter querysets dynamically")
190 "Django-filter is a generic, reusable application to alleviate writing
191 some of the more mundane bits of view code. Specifically, it allows users to
192 filter down a queryset based on a model’s fields, displaying the form to let
194 (license license:bsd-3)))
196 (define-public python2-django-filter
197 (package-with-python2 python-django-filter))
199 (define-public python-django-allauth
201 (name "python-django-allauth")
206 (uri (pypi-uri "django-allauth" version))
209 "1fslqc5qqb0b66yscvkyjwfv8cnbfx5nlkpnwimyb3pf1nc1w7r3"))))
210 (build-system python-build-system)
213 (modify-phases %standard-phases
214 ;; TODO: Tagging the tests requiring the web could be done upstream.
215 (add-before 'check 'skip-test-requiring-network-access
217 (substitute* "allauth/socialaccount/providers/openid/tests.py"
219 "from django.test import tag
224 (setenv "DJANGO_SETTINGS_MODULE" "test_settings")
230 "--exclude-tag=requires-web")))))))
232 `(("python-openid" ,python-openid)
233 ("python-requests" ,python-requests)
234 ("python-requests-oauthlib" ,python-requests-oauthlib)))
236 `(("python-mock" ,python-mock)))
238 `(("python-django" ,python-django)))
239 (home-page "https://github.com/pennersr/django-allauth")
240 (synopsis "Set of Django applications addressing authentication")
242 "Integrated set of Django applications addressing authentication,
243 registration, account management as well as 3rd party (social)
244 account authentication.")
245 (license license:expat)))
247 (define-public python2-django-allauth
248 (package-with-python2 python-django-allauth))
250 (define-public python-django-gravatar2
252 (name "python-django-gravatar2")
257 (uri (pypi-uri "django-gravatar2" version))
260 "1v4qyj6kms321yw0z2g1kch6b2dskmv6fjd6sfxzwr4xshq9mccl"))))
261 (build-system python-build-system)
263 `(("python-django" ,python-django)))
264 (home-page "https://github.com/twaddington/django-gravatar")
265 (synopsis "Gravatar support for Django, improved version")
267 "Essential Gravatar support for Django. Features helper methods,
268 templatetags and a full test suite.")
269 (license license:expat)))
271 (define-public python2-django-gravatar2
272 (package-with-python2 python-django-gravatar2))
274 (define-public python-django-assets
276 (name "python-django-assets")
280 (uri (pypi-uri "django-assets" version))
283 "0y0007fvkn1rdlj2g0y6k1cnkx53kxab3g8i85i0rd58k335p365"))))
284 (build-system python-build-system)
287 (modify-phases %standard-phases
288 (add-before 'check 'fix-tests
291 ;; https://github.com/miracle2k/django-assets/issues/87
292 (substitute* "tests/__init__.py"
293 (("settings.configure.*")
295 "settings.configure(\n"
296 "INSTALLED_APPS=['django_assets', "
297 "'django.contrib.staticfiles'],\n"
298 "TEMPLATES=[{'BACKEND': "
299 "'django.template.backends.django.DjangoTemplates'}],\n"
302 (substitute* "tests/test_django.py"
303 (("TestLoader") "NoTestLoader"))))))))
305 `(("python-nose" ,python-nose)))
307 `(("python-django" ,python-django)
308 ("python-webassets" ,python-webassets)))
309 (home-page "https://github.com/miracle2k/django-assets")
310 (synopsis "Asset management for Django")
312 "Asset management for Django, to compress and merge CSS and Javascript
313 files. Integrates the webassets library with Django, adding support for
314 merging, minifying and compiling CSS and Javascript files.")
315 (license license:bsd-2)))
317 (define-public python2-django-assets
318 (package-with-python2 python-django-assets))
320 (define-public python-django-jsonfield
322 (name "python-django-jsonfield")
326 (uri (pypi-uri "jsonfield" version))
329 "19x4lak0hg9c20r7mvf27w7i8r6i4sg2g0ypmlmp2665fnk76zvy"))))
330 (build-system python-build-system)
333 (modify-phases %standard-phases
334 (add-before 'check 'fix-tests
336 (substitute* "jsonfield/tests.py"
337 (("django.forms.util") "django.forms.utils")))))))
339 `(("python-django" ,python-django)))
340 (home-page "https://github.com/bradjasper/django-jsonfield")
341 (synopsis "Store validated JSON in your model")
343 "Django-jsonfield is a reusable Django field that allows you to store
344 validated JSON in your model. It silently takes care of serialization. To
345 use, simply add the field to one of your models.")
346 (license license:expat)))
348 (define-public python2-django-jsonfield
349 (package-with-python2 python-django-jsonfield))
351 (define-public python-dj-database-url
353 (name "python-dj-database-url")
357 (uri (pypi-uri "dj-database-url" version))
360 "024zbkc5rli4hia9lz9g8kf1zxhb2gwawj5abf67i7gf8n22v0x6"))))
361 (build-system python-build-system)
362 (home-page "https://github.com/kennethreitz/dj-database-url")
363 (synopsis "Use Database URLs in your Django Application")
365 "This simple Django utility allows you to utilize the 12factor inspired
366 DATABASE_URL environment variable to configure your Django application.
368 The dj_database_url.config method returns a Django database connection
369 dictionary, populated with all the data specified in your URL. There is also a
370 conn_max_age argument to easily enable Django’s connection pool.")
371 (license license:bsd-2)))
373 (define-public python2-dj-database-url
374 (package-with-python2 python-dj-database-url))
376 (define-public python-django-bulk-update
378 (name "python-django-bulk-update")
382 (uri (pypi-uri "django-bulk-update" version))
385 "0mbng9m7swfc0dnidipbzlxfhlfjrv755dlnha5s4m9mgdxb1fhc"))))
386 (build-system python-build-system)
388 ;; tests don't support django 1.10, but the module seems to work.
391 `(("six" ,python-six)
392 ("jsonfield" ,python-django-jsonfield)
393 ("python-dj-database-url" ,python-dj-database-url)))
395 `(("python-django" ,python-django)))
396 (home-page "https://github.com/aykut/django-bulk-update")
397 (synopsis "Simple bulk update over Django ORM or with helper function")
399 "Simple bulk update over Django ORM or with helper function. This
400 project aims to bulk update given objects using one query over Django ORM.")
401 (license license:expat)))
403 (define-public python2-django-bulk-update
404 (package-with-python2 python-django-bulk-update))
406 (define-public python-django-contact-form
408 (name "python-django-contact-form")
412 (uri (pypi-uri "django-contact-form" version))
415 "0az590y56k5ahv4sixrkn54d3a8ig2q2z9pl6s3m4f533mx2gj17"))))
416 (build-system python-build-system)
419 (modify-phases %standard-phases
422 ;; the next version will need "make test"
423 (and (zero? (system* "flake8" "contact_form"))
424 (zero? (system* "coverage" "run" "contact_form/runtests.py"))
425 (zero? (system* "coverage" "report" "-m" "--fail-under" "0"))))))))
427 `(("python-coverage" ,python-coverage)
428 ("python-flake8" ,python-flake8)))
430 `(("python-django" ,python-django)))
431 (home-page "https://github.com/ubernostrum/django-contact-form")
432 (synopsis "Contact form for Django")
434 "This application provides simple, extensible contact-form functionality
436 (license license:bsd-3)))
438 (define-public python2-django-contact-form
439 (package-with-python2 python-django-contact-form))
441 (define-public python-django-contrib-comments
443 (name "python-django-contrib-comments")
447 (uri (pypi-uri "django-contrib-comments" version))
450 "0bxsgw8jrkhg6r5s0z6ksfi4w8yknaqb1s9acmxd9pm3pnsnp5kx"))))
451 (build-system python-build-system)
453 `(("python-django" ,python-django)))
454 (home-page "https://github.com/django/django-contrib-comments")
455 (synopsis "Comments framework")
457 "Django used to include a comments framework; since Django 1.6 it's been
458 separated to a separate project. This is that project. This framework can be
459 used to attach comments to any model, so you can use it for comments on blog
460 entries, photos, book chapters, or anything else.")
461 (license license:bsd-3)))
463 (define-public python2-django-contrib-comments
464 (package-with-python2 python-django-contrib-comments))
466 (define-public python-django-overextends
468 (name "python-django-overextends")
472 (uri (pypi-uri "django-overextends" version))
475 "0qc2pcf3i56pmfxh2jw7k3pgljd8xzficmkl2541n7bkcbngqfzm"))))
476 (build-system python-build-system)
479 (modify-phases %standard-phases
482 (zero? (system* "./test_project/manage.py" "test")))))))
484 `(("python-django" ,python-django)))
486 `(("sphinx-me" ,python-sphinx-me)))
487 (home-page "https://github.com/stephenmcd/django-overextends")
488 (synopsis "Circular template inheritance")
490 "A Django reusable app providing the overextends template tag, a drop-in
491 replacement for Django's extends tag, which allows you to use circular template
492 inheritance. The primary use-case for overextends is to simultaneously
493 override and extend templates from other reusable apps, in your own Django
495 (license license:bsd-2)))
497 (define-public python2-django-overextends
498 (package-with-python2 python-django-overextends))
500 (define-public python-django-redis
502 (name "python-django-redis")
506 (uri (pypi-uri "django-redis" version))
509 "0yyyxv8n9l9dhs893jsqwg2cxqkkc79g719n9dzzzqgkzialv1c1"))))
510 (build-system python-build-system)
513 (modify-phases %standard-phases
516 (and (zero? (system* "redis-server" "--daemonize" "yes"))
517 (with-directory-excursion "tests"
518 (zero? (system* "python" "runtests.py")))))))))
520 `(("python-fakeredis" ,python-fakeredis)
521 ("python-hiredis" ,python-hiredis)
522 ("python-mock" ,python-mock)
523 ("python-msgpack" ,python-msgpack)
526 `(("python-django" ,python-django)
527 ("python-redis" ,python-redis)))
528 (home-page "https://github.com/niwibe/django-redis")
529 (synopsis "Full featured redis cache backend for Django")
531 "Full featured redis cache backend for Django.")
532 (license license:bsd-3)))
534 (define-public python2-django-redis
535 (package-with-python2 python-django-redis))
537 (define-public python-django-rq
539 (name "python-django-rq")
543 (uri (pypi-uri "django-rq" version))
546 "04v8ilfdp10bk31fxgh4cn083gsn5m06342cnpm5d10nd8hc0vky"))))
547 (build-system python-build-system)
550 (modify-phases %standard-phases
553 (and (zero? (system* "redis-server" "--daemonize" "yes"))
554 (zero? (system* "django-admin.py" "test" "django_rq"
555 "--settings=django_rq.test_settings"
556 "--pythonpath="))))))))
560 `(("python-django" ,python-django)
561 ("python-rq" ,python-rq)))
562 (home-page "https://github.com/ui/django-rq")
563 (synopsis "Django integration with RQ")
565 "Django integration with RQ, a Redis based Python queuing library.
566 Django-RQ is a simple app that allows you to configure your queues in django's
567 settings.py and easily use them in your project.")
568 (license license:expat)))
570 (define-public python2-django-rq
571 (package-with-python2 python-django-rq))
573 (define-public python-django-sortedm2m
575 (name "python-django-sortedm2m")
579 (uri (pypi-uri "django-sortedm2m" version))
582 "0axf765i7b3c2s83nlph47asi8s071dhq8l7y382v1pw785s22vi"))))
583 (build-system python-build-system)
588 `(("python-django" ,python-django)))
589 (home-page "https://github.com/gregmuellegger/django-sortedm2m")
590 (synopsis "Drop-in replacement for django's own ManyToManyField")
592 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
593 The provided SortedManyToManyField behaves like the original one but remembers
594 the order of added relations.")
595 (license license:bsd-3)))
597 (define-public python2-django-sortedm2m
598 (package-with-python2 python-django-sortedm2m))
600 (define-public python-django-appconf
602 (name "python-django-appconf")
606 (uri (pypi-uri "django-appconf" version))
609 "0qdjdx35g66xjsc50v0c5h3kg6njs8df33mbjx6j4k1vd3m9lkba"))))
610 (build-system python-build-system)
612 `(("python-django" ,python-django)))
613 (home-page "https://github.com/django-compressor/django-appconf")
614 (synopsis "Handle configuration defaults of packaged Django apps")
616 "This app precedes Django's own AppConfig classes that act as \"objects
617 [to] store metadata for an application\" inside Django's app loading mechanism.
618 In other words, they solve a related but different use case than
619 django-appconf and can't easily be used as a replacement. The similarity in
620 name is purely coincidental.")
621 (license license:bsd-3)))
623 (define-public python2-django-appconf
624 (package-with-python2 python-django-appconf))
626 (define-public python-django-statici18n
628 (name "python-django-statici18n")
632 (uri (pypi-uri "django-statici18n" version))
635 "0alcf4g1nv69njhq5k3qw4mfl2k6dc18bik5nk0g1mnp3m8zyz7k"))))
636 (build-system python-build-system)
638 `(("python-django" ,python-django)
639 ("django-appconf" ,python-django-appconf)))
640 (home-page "https://github.com/zyegfryed/django-statici18n")
641 (synopsis "Generate JavaScript catalog to static files")
643 "A Django app that provides helper for generating JavaScript catalog to
645 (license license:bsd-3)))
647 (define-public python2-django-statici18n
648 (package-with-python2 python-django-statici18n))
650 (define-public pootle
657 (uri (pypi-uri "Pootle" version ".tar.bz2"))
660 "0m6qcpkcy22dk3ad5y2k8851kqg2w6vrkywgy4vabwbacd7r1mvn"))))
661 (build-system python-build-system)
663 `(; pootle supports only python2.
665 ;; tests are not run and fail with "pytest_pootle/data/po/.tmp: No such
666 ;; file or directory". If we create this directory,
667 ;; pytest_pootle/data/po/terminology.po is missing.
670 (modify-phases %standard-phases
671 (add-before 'build 'fix-requirements
673 (substitute* "Pootle.egg-info/requires.txt"
676 (substitute* "requirements/tests.txt"
677 (("==3.0.6") ">=3.0.6"))
678 (substitute* "requirements/base.txt"
680 (("2.0.0") "2.1.0")))))))
682 `(("django-allauth" ,python2-django-allauth)
683 ("django-assets" ,python2-django-assets)
684 ("django-bulk-update" ,python2-django-bulk-update)
685 ("django-contact-form" ,python2-django-contact-form)
686 ("django-contrib-comments" ,python2-django-contrib-comments)
687 ("django-overextends" ,python2-django-overextends)
688 ("django-redis" ,python2-django-redis)
689 ("django-rq" ,python2-django-rq)
690 ("django-sortedm2m" ,python2-django-sortedm2m)
691 ("django-statici18n" ,python2-django-statici18n)
692 ("babel" ,python2-babel)
693 ("cssmin" ,python2-cssmin)
694 ("diff-match-patch" ,python2-diff-match-patch)
695 ("dirsync" ,python2-dirsync)
696 ("elasticsearch" ,python2-elasticsearch)
697 ("jsonfield" ,python2-django-jsonfield)
698 ("lxml" ,python2-lxml)
699 ("dateutil" ,python2-dateutil)
700 ("levenshtein" ,python2-levenshtein)
701 ("mysqlclient" ,python2-mysqlclient)
702 ("psycopg2" ,python2-psycopg2)
703 ("pytz" ,python2-pytz)
705 ("scandir" ,python2-scandir)
706 ("stemming" ,python2-stemming)
707 ("translate-toolkit" ,python2-translate-toolkit)))
709 `(("python2-pytest-warnings" ,python2-pytest-warnings)
710 ("python2-pytest-django" ,python2-pytest-django)
711 ("python2-pytest-catchlog" ,python2-pytest-catchlog)
712 ("python2-pytest-cov" ,python2-pytest-cov)
713 ("python2-factory-boy" ,python2-factory-boy)))
714 (home-page "http://pootle.translatehouse.org/")
715 (synopsis "Community localization server")
717 "Pootle is an online translation and localization tool. It works to
718 lower the barrier of entry, providing tools to enable teams to work towards
719 higher quality while welcoming newcomers.")
720 (license license:gpl3+)))