{"id":14972220,"url":"https://github.com/dmitri-sintsov/django-jinja-knockout","last_synced_at":"2025-05-16T11:02:29.866Z","repository":{"id":54131634,"uuid":"44978940","full_name":"Dmitri-Sintsov/django-jinja-knockout","owner":"Dmitri-Sintsov","description":"Django datatables and widgets, both AJAX and traditional. Display-only ModelForms. ModelForms / inline formsets with AJAX submit and validation. Works with Django templates.","archived":false,"fork":false,"pushed_at":"2024-11-14T20:15:35.000Z","size":11734,"stargazers_count":145,"open_issues_count":0,"forks_count":29,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T06:04:58.076Z","etag":null,"topics":["ajax-form","bootstrap3","bootstrap4","bootstrap5","datagrid","datatable-serverside","datatables","django","django-forms","django-formsets","django-framework","knockoutjs"],"latest_commit_sha":null,"homepage":"https://django-jinja-knockout.readthedocs.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dmitri-Sintsov.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-26T15:46:37.000Z","updated_at":"2025-01-23T21:39:05.000Z","dependencies_parsed_at":"2023-02-12T02:46:32.344Z","dependency_job_id":"a72d0df6-56b6-40be-8cb8-3bb7fc28e428","html_url":"https://github.com/Dmitri-Sintsov/django-jinja-knockout","commit_stats":{"total_commits":2011,"total_committers":10,"mean_commits":201.1,"dds":0.03530581800099453,"last_synced_commit":"af258ff3a6a9672192a098ada4183b04346fd49c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjango-jinja-knockout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjango-jinja-knockout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjango-jinja-knockout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjango-jinja-knockout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dmitri-Sintsov","download_url":"https://codeload.github.com/Dmitri-Sintsov/django-jinja-knockout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987184,"owners_count":21028891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax-form","bootstrap3","bootstrap4","bootstrap5","datagrid","datatable-serverside","datatables","django","django-forms","django-formsets","django-framework","knockoutjs"],"created_at":"2024-09-24T13:46:34.819Z","updated_at":"2025-05-16T11:02:29.859Z","avatar_url":"https://github.com/Dmitri-Sintsov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"=====================\ndjango-jinja-knockout\n=====================\n\n.. _aggregate: https://docs.djangoproject.com/en/dev/topics/db/aggregation/#generating-aggregates-over-a-queryset\n.. _axios: https://axios-http.com/docs/intro\n.. _Compound columns: https://django-jinja-knockout.readthedocs.io/en/latest/datatables.html#compound-columns\n.. _custom elements: https://github.com/Dmitri-Sintsov/django-jinja-knockout/blob/master/django_jinja_knockout/static/djk/js/elements.js\n.. _renderValue: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=renderValue\u0026unscoped_q=renderValue\n.. _renderNestedList: https://django-jinja-knockout.readthedocs.io/en/latest/datatables.html#nested-verbose-field-names\n.. _button_pagination: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=button_pagination\u0026type=code\n.. _Bootstrap 3: https://github.com/Dmitri-Sintsov/djk-bootstrap3\n.. _Bootstrap 4: https://github.com/Dmitri-Sintsov/djk-bootstrap4\n.. _Bootstrap 5: https://github.com/Dmitri-Sintsov/djk-bootstrap5\n.. _Bootstrap Icons: https://icons.getbootstrap.com/\n.. _data-bind: https://knockoutjs.com/documentation/binding-syntax.html\n.. _datatables: https://django-jinja-knockout.readthedocs.io/en/latest/datatables.html\n.. _django_deno: https://github.com/Dmitri-Sintsov/django-deno\n.. _django-jinja-knockout python localization: https://poeditor.com/join/project/9hqQrFEdDM\n.. _django-jinja-knockout javascript localization: https://poeditor.com/join/project/049HWzP3eb\n.. _djk_bootstrap5: https://github.com/Dmitri-Sintsov/djk-bootstrap5\n.. _empty_form: https://docs.djangoproject.com/en/dev/topics/forms/formsets/#empty-form\n.. _es6 modules: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules\n.. _fields_template: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=fields_template\n.. _FilteredRawQuerySet: https://django-jinja-knockout.readthedocs.io/en/latest/query.html#filteredrawqueryset\n.. _ForeignKeyGridWidget: https://django-jinja-knockout.readthedocs.io/en/latest/widgets.html#foreignkeygridwidget\n.. _ForeignKeyRawIdWidget: https://github.com/django/django/search?l=Python\u0026q=ForeignKeyRawIdWidget\n.. _FormFieldsRenderer: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=FormFieldsRenderer\n.. _get_absolute_url: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?l=Python\u0026q=get_absolute_url\n.. _iconui: https://django-jinja-knockout.readthedocs.io/en/latest/datatables.html#action-type-iconui\n.. _Jinja2: http://jinja.pocoo.org/docs/dev/\n.. _kiwnix: https://github.com/Dmitri-Sintsov/django-jinja-knockout/commits?author=kiwnix\n.. _Knockout.js: http://knockoutjs.com/\n.. _ko_grid_navs_filter_choices: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=ko_grid_navs_filter_choices\u0026type=code\n.. _ListView: https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-display/#listview\n.. _ListRangeFilter: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=ListRangeFilter\u0026type=code\n.. _ListSortingView: https://django-jinja-knockout.readthedocs.io/en/latest/views.html#listsortingview\n.. _KoGridView: https://django-jinja-knockout.readthedocs.io/en/latest/datatables.html\n.. _ListQuerySet: https://django-jinja-knockout.readthedocs.io/en/latest/query.html#listqueryset\n.. _many to many relationships: https://docs.djangoproject.com/en/dev/topics/db/examples/many_to_many/\n.. _ModelForm: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#modelform\n.. _MultipleKeyGridWidget: https://django-jinja-knockout.readthedocs.io/en/latest/datatables.html#multiplekeygridwidget\n.. _Nested components: https://django-jinja-knockout.readthedocs.io/en/latest/clientside.html#clientside-nested-components\n.. _ObjDict: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?l=Python\u0026q=objdict\n.. _PageContext: https://django-jinja-knockout.readthedocs.io/en/latest/context_processors.html#pagecontext-page-context\n.. _pageRouteKwargsKeys: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?l=Python\u0026q=pageRouteKwargsKeys\u0026type=code\n.. _pageRouteKwargsKeys example: https://github.com/Dmitri-Sintsov/djk-sample/search?q=pageRouteKwargsKeys\u0026type=code\n.. _prefetch_related(): https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.Prefetch\n.. _sample project: https://github.com/Dmitri-Sintsov/djk-sample\n.. _SystemJS: https://github.com/systemjs/systemjs\n.. _TemplateResponse: https://docs.djangoproject.com/en/dev/ref/template-response/\n.. _terser: https://terser.org\n.. _Tpl.domTemplate: https://github.com/Dmitri-Sintsov/django-jinja-knockout/search?q=domTemplate\u0026type=code\n.. _UrlPath: https://github.com/Dmitri-Sintsov/djk-sample/search?l=Python\u0026q=UrlPath\n.. _UrlSearchParams: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n.. _viewmodels: https://django-jinja-knockout.readthedocs.io/en/latest/viewmodels.html\n\n.. image:: https://badge.fury.io/py/django-jinja-knockout.png\n   :alt: PyPI package\n   :target: https://badge.fury.io/py/django-jinja-knockout\n\n.. image:: https://readthedocs.org/projects/django-jinja-knockout/badge/?version=latest\n    :alt: Documentation Status\n    :target: https://django-jinja-knockout.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://icons.iconarchive.com/icons/dtafalonso/android-lollipop/24/Youtube-icon.png\n    :alt: Watch selenium tests recorded videos.\n    :target: https://www.youtube.com/channel/UCZTrByxVSXdyW0z3e3qjTsQ\n\n.. image:: https://badges.gitter.im/django-jinja-knockout/Lobby.svg\n   :alt: Join the chat at https://gitter.im/django-jinja-knockout/Lobby\n   :target: https://gitter.im/django-jinja-knockout/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n\nScreenshot of the `sample project`_:\n\n.. image:: https://raw.githubusercontent.com/wiki/Dmitri-Sintsov/djk-sample/djk_edit_inline.png\n   :width: 740px\n\nMore screenshots with descriptions are available at: https://github.com/Dmitri-Sintsov/djk-sample/wiki\n\nDocumentation (in development): https://django-jinja-knockout.readthedocs.org/\n\n* Supports Django 4.2 LTS, 5.2; Python 3.10 / 3.11 / 3.12 / 3.13.\n\nPlease contribute to the localization of the project:\n\n* `django-jinja-knockout python localization`_\n* `django-jinja-knockout javascript localization`_\n\nLocalization:\n\n* Chinese: ``goldmonkey``\n* Dutch: ``Melvyn Sopacua``\n* Polish: ``pawelkoston``\n* Spanish: ``Julio Cesar Cabrera Cabrera``, `kiwnix`_\n\nKey features\n------------\n\n* AJAX based django.admin-like paginated `datatables`_ (grids) with sorting / filters and custom actions.\n* Integrates Jinja2 into existing Django templates (DTL).\n* `Bootstrap 3`_ / `Bootstrap 4`_ / `Bootstrap 5`_ / `Jinja2`_ / `Knockout.js`_ for Django projects.\n* No deep knowledge of Knockout.js is required: it has ready working components.\n* Dynamic adding / removing of inline formsets with Knockout.js, protected from XSS.\n* Default template renderers for Django forms / related forms / inline formsets with the possibility to override these\n  to customize the visual layout.\n* `ForeignKeyGridWidget`_ provides `ForeignKeyRawIdWidget`_-like functionality to select `ModelForm`_ foreign key\n  field value via AJAX query / response.\n* Django raw queries with ``filter()`` / ``exclude()`` / ``order()`` / ``values()`` / ``values_list()`` and SQL slicing\n  support via `FilteredRawQuerySet`_, suitable for usage in `ListView`_ / `ListSortingView`_ / `KoGridView`_ derived\n  classes.\n* `ListQuerySet`_ to query Python lists, including `prefetch_related()`_ results.\n* Jinja2 templates can be integrated into existing Django templates via custom template library tag::\n\n    {% extends 'base_min.html' %}\n    {% load jinja %}\n    {% load static %}\n\n    {% block main %}\n    {% jinja 'bs_list.htm' with _render_=1 view=view object_list=object_list is_paginated=is_paginated page_obj=page_obj %}\n    {% endblock main %}\n\nOverview\n--------\n\nKnockout.js uses unobtrusive `data-bind`_ HTML attributes with JSON-like values with causes no conflict to server-side\ndouble braces template syntax of DTL / Jinja2: no need to escape templates.\n\nCombining client-side Knockout.js templates and server-side Jinja2 templates allows to write more powerful and compact\ntemplate code.\n\nJinja2 is faster and is more powerful than built-in DTL templates. Jinja2 templates may be called from DTL templates\nby using custom template tag library ``{% load jinja %}``.\n\nUses\n----\n\n* https://github.com/knockout/knockout\n* https://github.com/mitsuhiko/jinja2\n* Provides DTL tag library to include Jinja2 templates into DTL templates.\n* Knockout.js is used to provide `datatables`_ and for XSS-safe `empty_form`_ handling.\n* AJAX form validation, AJAX `viewmodels`_ response routing are implemented via bundled client-side scripts.\n\nIt's not a pure SPA framework, but a mixed approach of server-side pages with embedded AJAX content and client-side\nscripts. Although it may be used for SPA as well. Classical Web applications aren't \"outdated\" in any way - because such\napplications are much better indexable by web crawlers, Python is better language than Javascript in general, also\nserver-side rendering generally is more robust.\n\nVersion 2.2.1\n-------------\nPython 3.12 / Django 5.2 compatibility.\n\nUse `axios`_ instead of outdated jQuery.form plugin.\n\nVersion 2.2.0\n-------------\n`FormFieldsRenderer`_ / `fields_template`_ allows fine-grained customization of `ModelForm`_ fields layout.\n\n`ListQuerySet`_ now has basic support of ``.delete()`` method and most common `aggregate`_ functions: ``Count``,\n``Min``, ``Max``, ``Sum``.\n\nLoad ``jQuery.form`` / ``Moment.js`` / Bootstrap Datetimepicker as `es6 modules`_, which may be included into\n`django_deno`_ generated bundle.\n\n``QueryString`` wrapper for `UrlSearchParams`_.\n\nAdditional `KoGridView`_ client-side layout options:\n\n* Bootstrap navs style of Grid filter choices: `ko_grid_navs_filter_choices`_\n* ``showNonSortableColumnNames`` option\n* `button_pagination`_ built-in action type\n\n`Nested components`_ are supported in Grid cells, including the cells of `Compound columns`_.\n\n`Tpl.domTemplate`_ optional template kwargs support.\n\n`djk_bootstrap5`_ now uses native `Bootstrap Icons`_ font for `iconui`_ actions.\n\nVarious bugfixes.\n\nVersion 2.1.0\n-------------\nBuilt-in `custom elements`_, including es5 IE11 polyfills.\n\n`Bootstrap 5`_ compatibility.\n\n`ObjDict`_ Django model serializer with built-in field permissions check for AJAX `viewmodels`_, including `datatables`_.\n\n`get_absolute_url`_ with optional user permission check / link title generation.\n\nVersion 2.0.0\n-------------\nBuilt-in `es6 modules`_ support for modern browsers.\n\nOptional `SystemJS`_ loader support for IE11 via `django_deno`_.\n\nOptional minified `terser`_ bundles support both for `es6 modules`_ and for `SystemJS`_ loader via `django_deno`_.\n\n`datatables`_ support separate cell click actions, not just row actions.\n\nMore throughout support for `datatables`_ annotated fields / virtual fields via ``grid_fields`` dicts.\n\nOptional lazy registration of client-side components.\n\nNumerous fixes, including improved related grid view kwargs auto-detection, see `pageRouteKwargsKeys`_ and\n`pageRouteKwargsKeys example`_.\n\n`ListRangeFilter`_ for `ListSortingView`_ range fields.\n\n.. _History: HISTORY.rst\n\n.. _Changes: CHANGES.rst\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-jinja-knockout.readthedocs.org.\n\n.. github relative links\n.. see setup.py\n\nQuick notes\n-----------\n\n.. Next links are github relative links. Do not process these via sphinx as it does not follow them correctly.\n.. _Credits: AUTHORS.rst\n.. _contribute: CONTRIBUTING.rst\n.. _Changes: CHANGES.rst\n.. _History: HISTORY.rst\n.. _Installation: INSTALLATION.rst\n.. _Introduction: QUICKSTART.rst\n\n* Installation_\n* Introduction_\n* How to contribute_\n* History_\n* Changes_\n* Credits_\n\nCookiecutter Tools Used in Making This Package\n----------------------------------------------\n\n*  cookiecutter\n*  cookiecutter-djangopackage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitri-sintsov%2Fdjango-jinja-knockout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitri-sintsov%2Fdjango-jinja-knockout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitri-sintsov%2Fdjango-jinja-knockout/lists"}