{ "info": { "author": "Thomas Khyn", "author_email": "thomas@ksytek.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Other Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Text Editors :: Text Processing" ], "description": "djinga\n======\n\n|copyright| 2014-2017 Thomas Khyn\n\nUnobtrusive jinja2 integration in Django\n\nTested with Django 1.8, 1.11 and 2.0 and the latest minor versions of Python 2\nand 3 (Django 2.0 only supports Python 3).\n\nIf you like ``djinga`` and are looking for a way to thank me and/or encourage\nfuture development, here is my BTC or BCH donation address:\n``1EwENyR8RV6tMc1hsLTkPURtn5wJgaBfG9``.\n\n\nWhy djinga ?\n------------\n\nSimply because no other jinja2 integration app for django met the requirements\nof a perfectionist django developer.\n\nDjinga enables you to:\n\n- Use django and jinja2 templates in the same project with dynamic selection\n of the template engine to use\n- Extend and include jinja2 templates from django ones and vice-versa\n- Insert django template code into jinja2 templates\n- Turn any django templatetag or python function into jinja2 filters or\n globals using decorators ... and without creating import loops\n- Extract translation strings from jinja2 templates with django's\n ``makemessages`` management command\n- Access useful jinja2 extensions, such as HTML compression, most django\n template's native tags and context processors\n\n\nUsage\n-----\n\n- Install djinga using the method of your choice\n- Add 'djinga' to your INSTALLED_APPS\n- Set the ``TEMPLATE`` setting as::\n\n TEMPLATES = [\n {\n 'BACKEND': 'djinga.backends.djinga.DjingaTemplates',\n 'DIRS': ['your/first/template/directory',\n 'your/second/template/directory'],\n 'OPTIONS': {\n ...\n },\n },\n ]\n\n- Add the relevant `options`_ for jinja2 and djinga\n\n\nHow it works\n------------\n\nBy default, a template will be rendered using Django's built-in template engine\nif it has a .html, .htm, .djhtml or .djhtm file extension. If it has a .jjhtml\nor .jjhtm file extension, it will be rendered by Jinja2, using the setting\nvalues provided in django's setting module.\n\n\nOptions\n-------\n\nSimply add the following options to the ``'OPTIONS'`` section of the\n``TEMPLATES`` item matching the djinga backend::\n\n TEMPLATES = [\n {\n 'BACKEND': 'djinga.backends.djinga.DjingaTemplates',\n 'OPTIONS': {\n 'option1': 'value1',\n 'option2': {'key1': 'val1',\n 'key2': 'val2'},\n ...\n },\n },\n ]\n\n\ndj_exts\n A list or tuple of file extensions (with or without the leading dot) for\n templates that should be rendered with Django's internal template engine.\n\n Defaults to ``('html', 'htm', 'jjhtml', 'jjhtm')``\n\njj_exts\n A list or tuple of the file extensions (with or without the leading dot) for\n templates that should be rendered with Jinja2.\n\n Defaults to ``('jjhtml', 'jjhtm')``\n\ncondition\n A function taking as sole argument the path of the template file and\n returning True if the file should be rendered with Jinja2. Defaults to a\n function returning True if the extension is in JINJA2_JJ_EXTS\n\nextensions\n A tuple or list of extensions to be loaded by jinja2 (as python objects or\n paths to the python objects). `Some extensions`_ are shipped with\n djinga under ``djinga.ext.*``.\n\nglobals\n The jinja2 globals as a dictionary.\n\nfilters\n The jinja2 filters as a dictionary.\n\nload_from\n A tuple or list of module paths to load globals and filters from. This\n advantageously complements or replaces the ``globals`` and\n ``filters`` options. See `Adding globals and filters`_ for details.\n\nany_jinja2_option\n Any other argument to construct a jinja2 environment may be provided.\n\n\nJinja2 extensions\n-----------------\n\nDjinga comes with several Jinja2 extensions:\n\ndjinga.ext.static\n Provides a ``{% static 'path' %}`` tag to refer to Django's staticfiles\n directory\n\ndjinga.ext.css\n Provides a ``{% css 'rel/path/to/file.css' %}`` tag that generates a\n HTML link element refering to the css file located at a relative path in\n a css directory. The css directory's path can be defined relatively to\n Django's staticfiles directory through the setting JINJA2_STATIC_CSS\n\ndjinga.ext.js\n Same as djinga.ext.css but generates a HTML script element refering to a\n javascript file. The js directory's relative path can be set through the\n setting JINJA2_STATIC_JS\n\ndjinga.ext.media\n Simply concatenates django's MEDIA_URL to the argument provided\n\ndjinga.ext.django\n From `a PR on coffin`_.\n Provides a ``{% django %}{% enddjango %}`` tag to include django template\n language in a jinja2 template. For this tag to work, the\n ``django.core.context_processors.request`` context processor must be\n enabled.\n\ndjinga.ext.csrf_token\n From coffin_\n Provides a Django-like ``{% csrf_token %}`` tag.\n\ndjinga.ext.url\n Provides a tag for URL reversing, similar to the django templates one.\n\ndjinga.ext.htmlcompress.HTMLCompress / SelectiveHTMLCompress\n Based on `Armin Ronacher's version`_.\n Eliminates useless whitespace at template compilation time without extra\n overhead. Since version 2.0, it also deals with inline javascript.\n\nDjango template tags\n--------------------\n\nThe following tags are automatically made available in any django template:\n\nextends\n Overrides the standard ``{% extends %}`` tag and enables it to refer to\n jinja2 files as well as normal django template files. While the template\n engine for the current file remains Django's one, the template engine for\n the extended file can be either Jinja2 or Django, depending on the file\n extension (in ``dj_exts`` or ``jj_exts``)\n\n\nAdding globals and filters\n--------------------------\n\nA straightforward way to add globals and filters and make them available from\nyour Jinja2 templates is to add them to the ``globals`` or the ``filters``\noptions in the settings module.\n\nHowever, this is not always convenient nor possible (import loops), and djinga\ntherefore provides a way to ease this process, through the ``jj_global`` and\n``jj_filter`` decorators in combination with the ``load_from`` option.\n\nBasically, the decorators mark the functions as Jinja2 globals or filters,\nwhile the setting (a list of module paths) indicates djinga where to look for\nthem.\n\nA short example is better than long explanations, so here we go.\n\nThis::\n\n [my_app/my_module.py]\n from djinga.register import jj_filter, jj_global\n\n @jj_global\n def my_tag(*args, **kw):\n pass\n\n @jj_filter\n def my_filter(*args, **kw)\n pass\n\n [settings.py] # django 1.8+\n TEMPLATES = [\n {\n 'BACKEND': 'djinga.backends.djinga.DjingaTemplates',\n 'OPTIONS': {\n 'load_from': ('my_app.my_module',),\n },\n },\n ]\n\n [settings.py] # django < 1.8\n JINJA2_LOAD_FROM = (\n 'my_app.my_module',\n )\n\nis equivalent to this::\n\n [my_app/my_module.py]\n def my_tag(*args):\n pass\n\n def my_filter(*args, **kw)\n pass\n\n [settings.py] # django 1.8+\n from my_app.my_module import my_tag, my_filter\n TEMPLATES = [\n {\n 'BACKEND': 'djinga.backends.djinga.DjingaTemplates',\n 'OPTIONS': {\n 'globals': {'my_tag': my_tag},\n 'filters': {'my_filter': my_filter},\n },\n },\n ]\n\n [settings.py] # django < 1.8\n from my_app.my_module import my_tag, my_filter\n JINJA2_GLOBALS = {'my_tag': my_tag}\n JINJA2_FILTERS = {'my_filter': my_filter}\n\n...with the significant advantage of not requiring a possibly issue-prone\n``import`` statement in the ``settings`` module.\n\nThe ``jj_global`` and ``jj_filter`` decorators are compatible with any of the\n`Jinja2 built-in decorators`_. They do not affect the behavior nor the\nsignature of the decorated function, so you can use it normally (as a normal\nDjango template tag or filter, for example).\n\nThe collected globals and filters are appended to the ones already specified\nin ``globals`` and ``filters``.\n\n\n``makemesssages`` management command\n------------------------------------\n\nAdapted from coffin_.\n\nDjinga overrides the Django ``makemessages`` core management command to include\nthe specific Jinja2 translation tags and ensure the strings marked for\ntranslation in Jinja2 templates appear in the translations dictionary.\n\n\n.. |copyright| unicode:: 0xA9\n\n.. _django-jinja: https://github.com/niwibe/django-jinja\n.. _django-jinja2: https://github.com/yuchant/django-jinja2\n.. _`Some extensions`: `Jinja2 extensions`_\n.. _`a PR on coffin`: https://github.com/coffin/coffin/pull/12/files?short_path=88b99bb#diff-e511b022f54e135b99f896c8fb355067R131\n.. _coffin: https://github.com/coffin/coffin/pull/12/files?short_path=88b99bb\n.. _`Armin Ronacher's version`: https://github.com/mitsuhiko/jinja2-htmlcompress/blob/master/jinja2htmlcompress.py\n.. _`Jinja2 built-in decorators`: http://jinja.pocoo.org/docs/api/#utilities\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/tkhyn/djinga", "keywords": "django", "license": "", "maintainer": "", "maintainer_email": "", "name": "djinga", "package_url": "https://pypi.org/project/djinga/", "platform": "", "project_url": "https://pypi.org/project/djinga/", "project_urls": { "Homepage": "https://bitbucket.org/tkhyn/djinga" }, "release_url": "https://pypi.org/project/djinga/2.1.2/", "requires_dist": null, "requires_python": "", "summary": "Unobtrusive jinja2 integration in Django", "version": "2.1.2" }, "last_serial": 3404995, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "8b793f2cef5d3b0f2b2b4584d2ce3c7c", "sha256": "26cf938e73118a38511fda4eff95e8cd2396376284beda29044f285303d7ef7b" }, "downloads": -1, "filename": "djinga-1.1-py2.7.egg", "has_sig": false, "md5_digest": "8b793f2cef5d3b0f2b2b4584d2ce3c7c", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 33096, "upload_time": "2014-07-20T09:51:25", "url": "https://files.pythonhosted.org/packages/8d/62/814e67d2cdf73ca2c0be7ed38f39c923b34dc9f8099b185a63e6a08c4961/djinga-1.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "b11842ce04691187164cfa97499c5dec", "sha256": "11ca650e7d16892e266effa64df1b8361ad2753cf61c697d427a0e1ad8dfbdb9" }, "downloads": -1, "filename": "djinga-1.1.zip", "has_sig": false, "md5_digest": "b11842ce04691187164cfa97499c5dec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19587, "upload_time": "2014-07-20T09:51:13", "url": "https://files.pythonhosted.org/packages/db/bb/453b2a343f81ed81ffd5e96f2f4284a1b6b48fa6faa13b22e0efbdd6b7b4/djinga-1.1.zip" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "2962a608a9de0802c700705b1211de2b", "sha256": "df44e636a43ca355ea4b117f5c182f5777bd411cf5bec2f2dc99763278818c26" }, "downloads": -1, "filename": "djinga-1.1.1-py2.7.egg", "has_sig": false, "md5_digest": "2962a608a9de0802c700705b1211de2b", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 36541, "upload_time": "2014-08-06T09:07:38", "url": "https://files.pythonhosted.org/packages/12/0f/ccb6ecbc38c6e76a1bccb35cbca45420da1344e1b6356acc53cf1f3d5269/djinga-1.1.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "4295ed9471915a2e856c6a7e006f35e2", "sha256": "5a8d70225fac363319ce8f3835438d82057d4682d9be8d7cf7424f019514fd0d" }, "downloads": -1, "filename": "djinga-1.1.1.zip", "has_sig": false, "md5_digest": "4295ed9471915a2e856c6a7e006f35e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20067, "upload_time": "2014-08-06T09:08:10", "url": "https://files.pythonhosted.org/packages/29/d2/af530b0acefc441f5157d6a9d5a87a78562c31bbfd7379db41c81b819e2b/djinga-1.1.1.zip" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "4fed7cca69faed659fa17c9508f84c7b", "sha256": "3f3ddb4e9d12cf120decf187ab10538fcb23ba85e5e779b6f93ac1933a184b70" }, "downloads": -1, "filename": "djinga-1.1.2.zip", "has_sig": false, "md5_digest": "4fed7cca69faed659fa17c9508f84c7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24929, "upload_time": "2014-08-15T01:06:31", "url": "https://files.pythonhosted.org/packages/bc/38/4badfefb306940d561fbff9e388c49c9c596365054e40fb7799b36d578ad/djinga-1.1.2.zip" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "fb3c0f366724ae1a152f2a0f2b14c47e", "sha256": "e5f782eb8de3edb5fe0d27dfe86219ae94a1300924b6abbee03ba7b8afc8bae8" }, "downloads": -1, "filename": "djinga-1.1.3.zip", "has_sig": false, "md5_digest": "fb3c0f366724ae1a152f2a0f2b14c47e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28745, "upload_time": "2015-04-15T12:11:43", "url": "https://files.pythonhosted.org/packages/83/52/83426acb56c6413c4c96a83921c8ad64e01fd4b820308def359c86b94544/djinga-1.1.3.zip" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "05c02ee3446da289d51cb68df85fcaf6", "sha256": "7b8ba9b28839867a33835104d963beee652601951b8144867b63b629f1e52fdd" }, "downloads": -1, "filename": "djinga-1.1.4.zip", "has_sig": false, "md5_digest": "05c02ee3446da289d51cb68df85fcaf6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28904, "upload_time": "2015-05-07T13:43:15", "url": "https://files.pythonhosted.org/packages/ed/fb/dc473a38088ec0463ccbabf5943cdfc776d765ed13366bc32fb2ba5c9521/djinga-1.1.4.zip" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "fc409aee64f27b63e292d56a77cc4965", "sha256": "128d2b56a369ae90559b6b3eb9fc06bdf85f1c9e80bfb935dadcec4f1d6e9a31" }, "downloads": -1, "filename": "djinga-1.1.5.zip", "has_sig": false, "md5_digest": "fc409aee64f27b63e292d56a77cc4965", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29706, "upload_time": "2015-05-09T22:48:42", "url": "https://files.pythonhosted.org/packages/84/41/d9048eb6938f7ceb692fac734bcb9a4214ba325fb151c81ac760b3b1dbed/djinga-1.1.5.zip" } ], "1.1.6": [ { "comment_text": "", "digests": { "md5": "c0e267288e4029d88069f01ce516dbde", "sha256": "25f41e532909053846c69fb830342de91d4fd90bf9e6dfc8f0fd34f4519db943" }, "downloads": -1, "filename": "djinga-1.1.6.zip", "has_sig": false, "md5_digest": "c0e267288e4029d88069f01ce516dbde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30065, "upload_time": "2015-10-22T01:24:25", "url": "https://files.pythonhosted.org/packages/e3/65/2bb1b343d9973cabbd4bc812cf4c16c998f0b54d66d942457f333d01561f/djinga-1.1.6.zip" } ], "1.1.7": [ { "comment_text": "", "digests": { "md5": "8189d12fa73df024526b4f28517d4037", "sha256": "062cdb84b5754d4f4c22fc47052975daaad3f2a3466a8fa25f9b1b54adf5bf79" }, "downloads": -1, "filename": "djinga-1.1.7.zip", "has_sig": false, "md5_digest": "8189d12fa73df024526b4f28517d4037", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30131, "upload_time": "2016-04-10T04:45:13", "url": "https://files.pythonhosted.org/packages/af/bc/6308da43240250ac1ce29204f16234a255da17090eec71ce8150474b9586/djinga-1.1.7.zip" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "522930f499e23f0b2f99fa5653aff6dc", "sha256": "522c9f07e1fd2e26b29c9cb98d3384a3c434c0db865f6dba33f67cf992466f65" }, "downloads": -1, "filename": "djinga-2.0.tar.gz", "has_sig": false, "md5_digest": "522930f499e23f0b2f99fa5653aff6dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15611, "upload_time": "2016-11-03T01:17:46", "url": "https://files.pythonhosted.org/packages/41/95/923326ffda54fdf2ea7735cae92f683d94eeeb0ca788a3c5620a6bf74bd5/djinga-2.0.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "0a7e45cfa19a9df368b84730df138e41", "sha256": "60207861eb8d81266e10a7186ad954c5874d5be71b376f34aa86cd1e628f72e9" }, "downloads": -1, "filename": "djinga-2.1.tar.gz", "has_sig": false, "md5_digest": "0a7e45cfa19a9df368b84730df138e41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15677, "upload_time": "2017-05-23T02:17:35", "url": "https://files.pythonhosted.org/packages/d7/a7/4a9b36c76e4a0baeaf16da128fb127a628a80b3f34fdfb9aa5d507a549e7/djinga-2.1.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "8ad3eefd5cfa6b10f815253542099482", "sha256": "d72a95356df99b8a6399ec843e3b0702c612a88453380de4723e8a4a645817b2" }, "downloads": -1, "filename": "djinga-2.1.1.tar.gz", "has_sig": false, "md5_digest": "8ad3eefd5cfa6b10f815253542099482", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15729, "upload_time": "2017-09-05T03:32:15", "url": "https://files.pythonhosted.org/packages/79/36/e73c73cc65b983cde9e42872a1fb451f3aaea2042bb66db54cff81d34e81/djinga-2.1.1.tar.gz" } ], "2.1.2": [ { "comment_text": "", "digests": { "md5": "1d96f02d903c3cd79465c2955cf60ca8", "sha256": "147a2ade2544db21ac466b1cfc11086e5df0dc7b7887cd34957294e09f1a93d4" }, "downloads": -1, "filename": "djinga-2.1.2.tar.gz", "has_sig": false, "md5_digest": "1d96f02d903c3cd79465c2955cf60ca8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15762, "upload_time": "2017-12-10T08:46:19", "url": "https://files.pythonhosted.org/packages/db/56/405421410e23bc2d70d64d309c3af71f7faff8ff84011ea0144bae103e3d/djinga-2.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1d96f02d903c3cd79465c2955cf60ca8", "sha256": "147a2ade2544db21ac466b1cfc11086e5df0dc7b7887cd34957294e09f1a93d4" }, "downloads": -1, "filename": "djinga-2.1.2.tar.gz", "has_sig": false, "md5_digest": "1d96f02d903c3cd79465c2955cf60ca8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15762, "upload_time": "2017-12-10T08:46:19", "url": "https://files.pythonhosted.org/packages/db/56/405421410e23bc2d70d64d309c3af71f7faff8ff84011ea0144bae103e3d/djinga-2.1.2.tar.gz" } ] }