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 python))
32 (define-public python-django
34 (name "python-django")
38 (uri (pypi-uri "Django" version))
41 "1fwqqh2zbcy9dy0lnvk338s11llnnfz2k56bf84w0wv56ayq7vyl"))))
42 (build-system python-build-system)
45 (modify-phases %standard-phases
46 (add-before 'check 'set-tzdir
47 (lambda* (#:key inputs #:allow-other-keys)
48 ;; The test-suite tests timezone-dependent functions, thus tzdata
49 ;; needs to be available.
51 (string-append (assoc-ref inputs "tzdata")
57 (string-append ".:" (getenv "PYTHONPATH")))
58 (zero? (system* "python" "tests/runtests.py")))))))
59 ;; TODO: Install extras/django_bash_completion.
62 ;; bcrypt and argon2-cffi are extra requirements not yet in guix
63 ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0
64 ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt!
65 ;; Remaining packages are test requirements taken from
66 ;; tests/requirements/py3.txt
67 ("python-docutils" ,python-docutils)
68 ;; optional for tests: ("python-geoip2" ,python-geoip2)
69 ("python-jinja2" ,python-jinja2) ; >= 2.7
70 ;; optional for tests: ("python-memcached" ,python-memcached)
71 ("python-numpy" ,python-numpy)
72 ("python-pillow" ,python-pillow)
73 ("python-pyyaml" ,python-pyyaml)
74 ("python-pytz" ,python-pytz)
75 ;; optional for tests: ("python-selenium" ,python-selenium)
76 ("python-sqlparse" ,python-sqlparse)
77 ("python-tblib" ,python-tblib)))
78 (home-page "http://www.djangoproject.com/")
79 (synopsis "High-level Python Web framework")
81 "Django is a high-level Python Web framework that encourages rapid
82 development and clean, pragmatic design. It provides many tools for building
83 any Web site. Django focuses on automating as much as possible and adhering
84 to the @dfn{don't repeat yourself} (DRY) principle.")
85 (license license:bsd-3)
86 (properties `((python2-variant . ,(delay python2-django))
87 (cpe-name . "django")))))
89 (define-public python2-django
90 (let ((base (package-with-python2 (strip-python2-variant python-django))))
94 `(;; Test requirements for Python 2 taken from
95 ;; tests/requirements/py3.txt: enum34 and mock.
96 ("python2-enum34" ,python2-enum34)
97 ("python2-mock" ,python2-mock)
98 ;; When adding memcached mind: for Python 2 memcached <= 1.53 is
100 ,@(package-native-inputs base))))))
102 (define-public python-django-simple-math-captcha
104 (name "python-django-simple-math-captcha")
108 (uri (pypi-uri "django-simple-math-captcha" version))
111 "0906hms6y6znjhpd0g4wmzv9vcla4brkdpsm4zha9zdj8g5vq2hd"))))
112 (build-system python-build-system)
114 ;; FIXME: Upstream uses a 'runtests.py' script that is not
115 ;; present in the pypi tarball.
118 `(("python-django" ,python-django)))
119 (home-page "https://github.com/alsoicode/django-simple-math-captcha")
120 (synopsis "Easy-to-use math field/widget captcha for Django forms")
122 "A multi-value-field that presents a human answerable question,
123 with no settings.py configuration necessary, but instead can be configured
124 with arguments to the field constructor.")
125 (license license:asl2.0)))
127 (define-public python2-django-simple-math-captcha
128 (package-with-python2 python-django-simple-math-captcha))
130 (define-public python-pytest-django
132 (name "python-pytest-django")
136 (uri (pypi-uri "pytest-django" version))
139 "02932m2sr8x22m4az8syr8g835g4ak77varrnw71n6xakmdcr303"))))
140 (build-system python-build-system)
142 `(#:tests? #f ; FIXME: How to run tests?
144 (modify-phases %standard-phases
145 (add-after 'unpack 'patch-setuppy
147 (substitute* "setup.py"
148 (("setuptools_scm==1.11.1") "setuptools_scm"))
151 `(("python-django" ,python-django)
152 ("python-setuptools-scm" ,python-setuptools-scm)))
154 `(("python-pytest" ,python-pytest-3.0)))
155 (home-page "http://pytest-django.readthedocs.org/")
156 (synopsis "Django plugin for py.test")
157 (description "Pytest-django is a plugin for py.test that provides a set of
158 useful tools for testing Django applications and projects.")
159 (license license:bsd-3)))
161 (define-public python2-pytest-django
162 (package-with-python2 python-pytest-django))
164 (define-public python-django-filter
166 (name "python-django-filter")
170 (uri (pypi-uri "django-filter" version))
173 "0f78hmk8c903zwfzlsiw7ivgag81ymmb5hi73rzxbhnlg2v0l3fx"))))
174 (build-system python-build-system)
177 (modify-phases %standard-phases
180 (zero? (system* "python" "runtests.py")))))))
182 `(("python-django" ,python-django)
183 ("python-mock" ,python-mock)))
184 (home-page "https://django-filter.readthedocs.io/en/latest/")
185 (synopsis "Reusable Django application to filter querysets dynamically")
187 "Django-filter is a generic, reusable application to alleviate writing
188 some of the more mundane bits of view code. Specifically, it allows users to
189 filter down a queryset based on a model’s fields, displaying the form to let
191 (license license:bsd-3)))
193 (define-public python2-django-filter
194 (package-with-python2 python-django-filter))
196 (define-public python-django-allauth
198 (name "python-django-allauth")
203 (uri (pypi-uri "django-allauth" version))
206 "1fslqc5qqb0b66yscvkyjwfv8cnbfx5nlkpnwimyb3pf1nc1w7r3"))))
207 (build-system python-build-system)
209 `(("python-openid" ,python-openid)
210 ("python-requests" ,python-requests)
211 ("python-requests-oauthlib" ,python-requests-oauthlib)))
213 `(("python-mock" ,python-mock)))
215 `(("python-django" ,python-django)))
216 (home-page "https://github.com/pennersr/django-allauth")
217 (synopsis "Set of Django applications addressing authentication")
219 "Integrated set of Django applications addressing authentication,
220 registration, account management as well as 3rd party (social)
221 account authentication.")
222 (license license:expat)))
224 (define-public python2-django-allauth
225 (package-with-python2 python-django-allauth))
227 (define-public python-django-gravatar2
229 (name "python-django-gravatar2")
234 (uri (pypi-uri "django-gravatar2" version))
237 "1v4qyj6kms321yw0z2g1kch6b2dskmv6fjd6sfxzwr4xshq9mccl"))))
238 (build-system python-build-system)
240 `(("python-django" ,python-django)))
241 (home-page "https://github.com/twaddington/django-gravatar")
242 (synopsis "Gravatar support for Django, improved version")
244 "Essential Gravatar support for Django. Features helper methods,
245 templatetags and a full test suite.")
246 (license license:expat)))
248 (define-public python2-django-gravatar2
249 (package-with-python2 python-django-gravatar2))
251 (define-public python-django-assets
253 (name "python-django-assets")
257 (uri (pypi-uri "django-assets" version))
260 "0y0007fvkn1rdlj2g0y6k1cnkx53kxab3g8i85i0rd58k335p365"))))
261 (build-system python-build-system)
264 (modify-phases %standard-phases
265 (add-before 'check 'fix-tests
268 ;; https://github.com/miracle2k/django-assets/issues/87
269 (substitute* "tests/__init__.py"
270 (("settings.configure.*")
272 "settings.configure(\n"
273 "INSTALLED_APPS=['django_assets', "
274 "'django.contrib.staticfiles'],\n"
275 "TEMPLATES=[{'BACKEND': "
276 "'django.template.backends.django.DjangoTemplates'}],\n"
279 (substitute* "tests/test_django.py"
280 (("TestLoader") "NoTestLoader"))))))))
282 `(("python-nose" ,python-nose)))
284 `(("python-django" ,python-django)
285 ("python-webassets" ,python-webassets)))
286 (home-page "https://github.com/miracle2k/django-assets")
287 (synopsis "Asset management for Django")
289 "Asset management for Django, to compress and merge CSS and Javascript
290 files. Integrates the webassets library with Django, adding support for
291 merging, minifying and compiling CSS and Javascript files.")
292 (license license:bsd-2)))
294 (define-public python2-django-assets
295 (package-with-python2 python-django-assets))
297 (define-public python-django-jsonfield
299 (name "python-django-jsonfield")
303 (uri (pypi-uri "jsonfield" version))
306 "19x4lak0hg9c20r7mvf27w7i8r6i4sg2g0ypmlmp2665fnk76zvy"))))
307 (build-system python-build-system)
310 (modify-phases %standard-phases
311 (add-before 'check 'fix-tests
313 (substitute* "jsonfield/tests.py"
314 (("django.forms.util") "django.forms.utils")))))))
316 `(("python-django" ,python-django)))
317 (home-page "https://github.com/bradjasper/django-jsonfield")
318 (synopsis "Store validated JSON in your model")
320 "Django-jsonfield is a reusable Django field that allows you to store
321 validated JSON in your model. It silently takes care of serialization. To
322 use, simply add the field to one of your models.")
323 (license license:expat)))
325 (define-public python2-django-jsonfield
326 (package-with-python2 python-django-jsonfield))
328 (define-public python-dj-database-url
330 (name "python-dj-database-url")
334 (uri (pypi-uri "dj-database-url" version))
337 "024zbkc5rli4hia9lz9g8kf1zxhb2gwawj5abf67i7gf8n22v0x6"))))
338 (build-system python-build-system)
339 (home-page "https://github.com/kennethreitz/dj-database-url")
340 (synopsis "Use Database URLs in your Django Application")
342 "This simple Django utility allows you to utilize the 12factor inspired
343 DATABASE_URL environment variable to configure your Django application.
345 The dj_database_url.config method returns a Django database connection
346 dictionary, populated with all the data specified in your URL. There is also a
347 conn_max_age argument to easily enable Django’s connection pool.")
348 (license license:bsd-2)))
350 (define-public python2-dj-database-url
351 (package-with-python2 python-dj-database-url))
353 (define-public python-django-bulk-update
355 (name "python-django-bulk-update")
359 (uri (pypi-uri "django-bulk-update" version))
362 "0mbng9m7swfc0dnidipbzlxfhlfjrv755dlnha5s4m9mgdxb1fhc"))))
363 (build-system python-build-system)
365 ;; tests don't support django 1.10, but the module seems to work.
368 `(("six" ,python-six)
369 ("jsonfield" ,python-django-jsonfield)
370 ("python-dj-database-url" ,python-dj-database-url)))
372 `(("python-django" ,python-django)))
373 (home-page "https://github.com/aykut/django-bulk-update")
374 (synopsis "Simple bulk update over Django ORM or with helper function")
376 "Simple bulk update over Django ORM or with helper function. This
377 project aims to bulk update given objects using one query over Django ORM.")
378 (license license:expat)))
380 (define-public python2-django-bulk-update
381 (package-with-python2 python-django-bulk-update))
383 (define-public python-django-contact-form
385 (name "python-django-contact-form")
389 (uri (pypi-uri "django-contact-form" version))
392 "0az590y56k5ahv4sixrkn54d3a8ig2q2z9pl6s3m4f533mx2gj17"))))
393 (build-system python-build-system)
396 (modify-phases %standard-phases
399 ;; the next version will need "make test"
400 (and (zero? (system* "flake8" "contact_form"))
401 (zero? (system* "coverage" "run" "contact_form/runtests.py"))
402 (zero? (system* "coverage" "report" "-m" "--fail-under" "0"))))))))
404 `(("python-coverage" ,python-coverage)
405 ("python-flake8" ,python-flake8)))
407 `(("python-django" ,python-django)))
408 (home-page "https://github.com/ubernostrum/django-contact-form")
409 (synopsis "Contact form for Django")
411 "This application provides simple, extensible contact-form functionality
413 (license license:bsd-3)))
415 (define-public python2-django-contact-form
416 (package-with-python2 python-django-contact-form))
418 (define-public python-django-contrib-comments
420 (name "python-django-contrib-comments")
424 (uri (pypi-uri "django-contrib-comments" version))
427 "0bxsgw8jrkhg6r5s0z6ksfi4w8yknaqb1s9acmxd9pm3pnsnp5kx"))))
428 (build-system python-build-system)
430 `(("python-django" ,python-django)))
431 (home-page "https://github.com/django/django-contrib-comments")
432 (synopsis "Comments framework")
434 "Django used to include a comments framework; since Django 1.6 it's been
435 separated to a separate project. This is that project. This framework can be
436 used to attach comments to any model, so you can use it for comments on blog
437 entries, photos, book chapters, or anything else.")
438 (license license:bsd-3)))
440 (define-public python2-django-contrib-comments
441 (package-with-python2 python-django-contrib-comments))
443 (define-public python-django-overextends
445 (name "python-django-overextends")
449 (uri (pypi-uri "django-overextends" version))
452 "0qc2pcf3i56pmfxh2jw7k3pgljd8xzficmkl2541n7bkcbngqfzm"))))
453 (build-system python-build-system)
456 (modify-phases %standard-phases
459 (zero? (system* "./test_project/manage.py" "test")))))))
461 `(("python-django" ,python-django)))
463 `(("sphinx-me" ,python-sphinx-me)))
464 (home-page "https://github.com/stephenmcd/django-overextends")
465 (synopsis "Circular template inheritance")
467 "A Django reusable app providing the overextends template tag, a drop-in
468 replacement for Django's extends tag, which allows you to use circular template
469 inheritance. The primary use-case for overextends is to simultaneously
470 override and extend templates from other reusable apps, in your own Django
472 (license license:bsd-2)))
474 (define-public python2-django-overextends
475 (package-with-python2 python-django-overextends))
477 (define-public python-django-redis
479 (name "python-django-redis")
483 (uri (pypi-uri "django-redis" version))
486 "0yyyxv8n9l9dhs893jsqwg2cxqkkc79g719n9dzzzqgkzialv1c1"))))
487 (build-system python-build-system)
490 (modify-phases %standard-phases
493 (and (zero? (system* "redis-server" "--daemonize" "yes"))
494 (with-directory-excursion "tests"
495 (zero? (system* "python" "runtests.py")))))))))
497 `(("python-fakeredis" ,python-fakeredis)
498 ("python-hiredis" ,python-hiredis)
499 ("python-mock" ,python-mock)
500 ("python-msgpack" ,python-msgpack)
503 `(("python-django" ,python-django)
504 ("python-redis" ,python-redis)))
505 (home-page "https://github.com/niwibe/django-redis")
506 (synopsis "Full featured redis cache backend for Django")
508 "Full featured redis cache backend for Django.")
509 (license license:bsd-3)))
511 (define-public python2-django-redis
512 (package-with-python2 python-django-redis))
514 (define-public python-django-rq
516 (name "python-django-rq")
520 (uri (pypi-uri "django-rq" version))
523 "04v8ilfdp10bk31fxgh4cn083gsn5m06342cnpm5d10nd8hc0vky"))))
524 (build-system python-build-system)
527 (modify-phases %standard-phases
530 (and (zero? (system* "redis-server" "--daemonize" "yes"))
531 (zero? (system* "django-admin.py" "test" "django_rq"
532 "--settings=django_rq.test_settings"
533 "--pythonpath="))))))))
537 `(("python-django" ,python-django)
538 ("python-rq" ,python-rq)))
539 (home-page "https://github.com/ui/django-rq")
540 (synopsis "Django integration with RQ")
542 "Django integration with RQ, a Redis based Python queuing library.
543 Django-RQ is a simple app that allows you to configure your queues in django's
544 settings.py and easily use them in your project.")
545 (license license:expat)))
547 (define-public python2-django-rq
548 (package-with-python2 python-django-rq))
550 (define-public python-django-sortedm2m
552 (name "python-django-sortedm2m")
556 (uri (pypi-uri "django-sortedm2m" version))
559 "0axf765i7b3c2s83nlph47asi8s071dhq8l7y382v1pw785s22vi"))))
560 (build-system python-build-system)
565 `(("python-django" ,python-django)))
566 (home-page "https://github.com/gregmuellegger/django-sortedm2m")
567 (synopsis "Drop-in replacement for django's own ManyToManyField")
569 "Sortedm2m is a drop-in replacement for django's own ManyToManyField.
570 The provided SortedManyToManyField behaves like the original one but remembers
571 the order of added relations.")
572 (license license:bsd-3)))
574 (define-public python2-django-sortedm2m
575 (package-with-python2 python-django-sortedm2m))
577 (define-public python-django-appconf
579 (name "python-django-appconf")
583 (uri (pypi-uri "django-appconf" version))
586 "0qdjdx35g66xjsc50v0c5h3kg6njs8df33mbjx6j4k1vd3m9lkba"))))
587 (build-system python-build-system)
589 `(("python-django" ,python-django)))
590 (home-page "https://github.com/django-compressor/django-appconf")
591 (synopsis "Handle configuration defaults of packaged Django apps")
593 "This app precedes Django's own AppConfig classes that act as \"objects
594 [to] store metadata for an application\" inside Django's app loading mechanism.
595 In other words, they solve a related but different use case than
596 django-appconf and can't easily be used as a replacement. The similarity in
597 name is purely coincidental.")
598 (license license:bsd-3)))
600 (define-public python2-django-appconf
601 (package-with-python2 python-django-appconf))
603 (define-public python-django-statici18n
605 (name "python-django-statici18n")
609 (uri (pypi-uri "django-statici18n" version))
612 "0alcf4g1nv69njhq5k3qw4mfl2k6dc18bik5nk0g1mnp3m8zyz7k"))))
613 (build-system python-build-system)
615 `(("python-django" ,python-django)
616 ("django-appconf" ,python-django-appconf)))
617 (home-page "https://github.com/zyegfryed/django-statici18n")
618 (synopsis "Generate JavaScript catalog to static files")
620 "A Django app that provides helper for generating JavaScript catalog to
622 (license license:bsd-3)))
624 (define-public python2-django-statici18n
625 (package-with-python2 python-django-statici18n))
627 (define-public pootle
634 (uri (pypi-uri "Pootle" version ".tar.bz2"))
637 "0m6qcpkcy22dk3ad5y2k8851kqg2w6vrkywgy4vabwbacd7r1mvn"))))
638 (build-system python-build-system)
640 `(; pootle supports only python2.
642 ;; tests are not run and fail with "pytest_pootle/data/po/.tmp: No such
643 ;; file or directory". If we create this directory,
644 ;; pytest_pootle/data/po/terminology.po is missing.
647 (modify-phases %standard-phases
648 (add-before 'build 'fix-requirements
650 (substitute* "Pootle.egg-info/requires.txt"
653 (substitute* "requirements/tests.txt"
654 (("==3.0.6") ">=3.0.6"))
655 (substitute* "requirements/base.txt"
657 (("2.0.0") "2.1.0")))))))
659 `(("django-allauth" ,python2-django-allauth)
660 ("django-assets" ,python2-django-assets)
661 ("django-bulk-update" ,python2-django-bulk-update)
662 ("django-contact-form" ,python2-django-contact-form)
663 ("django-contrib-comments" ,python2-django-contrib-comments)
664 ("django-overextends" ,python2-django-overextends)
665 ("django-redis" ,python2-django-redis)
666 ("django-rq" ,python2-django-rq)
667 ("django-sortedm2m" ,python2-django-sortedm2m)
668 ("django-statici18n" ,python2-django-statici18n)
669 ("babel" ,python2-babel)
670 ("cssmin" ,python2-cssmin)
671 ("diff-match-patch" ,python2-diff-match-patch)
672 ("dirsync" ,python2-dirsync)
673 ("elasticsearch" ,python2-elasticsearch)
674 ("jsonfield" ,python2-django-jsonfield)
675 ("lxml" ,python2-lxml)
676 ("dateutil" ,python2-dateutil)
677 ("levenshtein" ,python2-levenshtein)
678 ("mysqlclient" ,python2-mysqlclient)
679 ("psycopg2" ,python2-psycopg2)
680 ("pytz" ,python2-pytz)
682 ("scandir" ,python2-scandir)
683 ("stemming" ,python2-stemming)
684 ("translate-toolkit" ,python2-translate-toolkit)))
686 `(("python2-pytest-warnings" ,python2-pytest-warnings)
687 ("python2-pytest-django" ,python2-pytest-django)
688 ("python2-pytest-catchlog" ,python2-pytest-catchlog)
689 ("python2-pytest-cov" ,python2-pytest-cov)
690 ("python2-factory-boy" ,python2-factory-boy)))
691 (home-page "http://pootle.translatehouse.org/")
692 (synopsis "Community localization server")
694 "Pootle is an online translation and localization tool. It works to
695 lower the barrier of entry, providing tools to enable teams to work towards
696 higher quality while welcoming newcomers.")
697 (license license:gpl3+)))