{"id":16412022,"url":"https://github.com/dmitri-sintsov/djk-sample","last_synced_at":"2025-08-24T16:10:24.576Z","repository":{"id":46616081,"uuid":"65234515","full_name":"Dmitri-Sintsov/djk-sample","owner":"Dmitri-Sintsov","description":"Sample Django project for django-jinja-knockout","archived":false,"fork":false,"pushed_at":"2025-04-30T16:48:04.000Z","size":1181,"stargazers_count":17,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-29T19:09:11.978Z","etag":null,"topics":["datatables","django-application"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dmitri-Sintsov.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-08-08T19:54:04.000Z","updated_at":"2025-04-30T16:48:08.000Z","dependencies_parsed_at":"2024-10-28T15:27:39.493Z","dependency_job_id":"3753d36b-a8a7-43df-a460-2f8da3f3419e","html_url":"https://github.com/Dmitri-Sintsov/djk-sample","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Dmitri-Sintsov/djk-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjk-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjk-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjk-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjk-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dmitri-Sintsov","download_url":"https://codeload.github.com/Dmitri-Sintsov/djk-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dmitri-Sintsov%2Fdjk-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271900779,"owners_count":24841114,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["datatables","django-application"],"created_at":"2024-10-11T06:47:20.810Z","updated_at":"2025-08-24T16:10:24.569Z","avatar_url":"https://github.com/Dmitri-Sintsov.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==========\ndjk-sample\n==========\n\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.. _Chrome: https://www.google.com/chrome/\n.. _ChromeDriver: https://sites.google.com/a/chromium.org/chromedriver/\n.. _cherry_django.sh: https://github.com/Dmitri-Sintsov/djk-sample/blob/master/cli/cherry_django.sh\n.. _Firefox ESR: https://www.mozilla.org/en-US/firefox/organizations/\n.. _fixtures_order: https://github.com/Dmitri-Sintsov/djk-sample/search?l=Python\u0026q=fixtures_order\u0026utf8=%E2%9C%93\n.. _geckodriver: https://github.com/mozilla/geckodriver/releases\n.. _django_deno: https://github.com/Dmitri-Sintsov/django-deno\n.. _deno rollup: https://deno.land/x/drollup\n.. _settings.py: https://github.com/Dmitri-Sintsov/djk-sample/blob/master/djk_sample/settings.py\n.. _system.js: https://github.com/systemjs/systemjs\n.. _dump_data: https://github.com/Dmitri-Sintsov/djk-sample/search?l=Python\u0026q=dump_data\u0026utf8=%E2%9C%93\n.. _has_fixture: https://github.com/Dmitri-Sintsov/djk-sample/search?l=Python\u0026q=has_fixture\u0026utf8=%E2%9C%93\n.. _djk_sample/tests.py: https://github.com/Dmitri-Sintsov/djk-sample/blob/master/djk_sample/tests.py\n.. _terser: https://github.com/terser/terser\n\n\nSample Django project for django-jinja-knockout: https://github.com/Dmitri-Sintsov/django-jinja-knockout\n\n.. image:: https://circleci.com/gh/Dmitri-Sintsov/djk-sample.svg?style=shield\n    :target: https://circleci.com/gh/Dmitri-Sintsov/djk-sample\n..\n   https://iconarchive.com/show/android-lollipop-icons-by-dtafalonso/Youtube-icon.html\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\nScreenshot:\n\n.. image:: https://raw.githubusercontent.com/wiki/Dmitri-Sintsov/djk-sample/djk_change_or_create_foreign_key_for_inline_form.png\n   :width: 740px\n\nRecorded video: https://www.youtube.com/watch?v=CJLdtFaXhKo\n\nInstallation\n------------\n\nUbuntu\n~~~~~~\n\n.. highlight:: shell\n\nTested in Ubuntu 20.04 LTS::\n\n    sudo apt-get install git\n    python3 -m venv djk-sample\n    cd djk-sample\n    source bin/activate\n    git clone https://github.com/Dmitri-Sintsov/djk-sample.git\n    cd djk-sample\n    # Uncomment next line to use v2.2.1 instead of development version:\n    # git checkout tags/v2.2.1\n    python3 -m pip install -U -r requirements.txt\n\nTo use the current stable `Bootstrap 3`_ version of ``djk_ui``::\n\n    python3 -m pip install -U -r requirements/bs3.txt\n\nor::\n\n    python3 -m pip install -U wheel/djk_bootstrap3-2.2.1-py2.py3-none-any.whl\n\nTo use the current stable `Bootstrap 4`_ version of ``djk_ui``::\n\n    python3 -m pip install -U -r requirements/bs4.txt\n\nor::\n\n    python3 -m pip install -U wheel/djk_bootstrap4-2.2.1-py2.py3-none-any.whl\n\nTo use the development `Bootstrap 3`_ version::\n\n    ./cli/3bs.sh\n\nTo use the development `Bootstrap 4`_ version::\n\n    ./cli/4bs.sh\n\nTo use the development `Bootstrap 5`_ version::\n\n    ./cli/5bs.sh\n\nthen::\n\n    mkdir \"$VIRTUAL_ENV/djk-sample/logs/\"\n    mkdir \"$VIRTUAL_ENV/djk-sample/fixtures/\"\n    python3 manage.py makemigrations club_app event_app\n    python3 manage.py migrate\n    apt install gettext\n    python3 manage.py compilemessages\n    python3 manage.py runserver\n\nShell scripts ``cli/3bs.sh`` / ``cli/4bs.sh`` / ``cli/5bs.sh`` allow to switch the Bootstrap version on the fly, using the development\n(not always stable) version of ``djk_ui``.\n\nInstall Deno (optional)::\n\n    curl -fsSL https://deno.land/x/install/install.sh | sh\n    export DENO_INSTALL=$HOME/.deno\n\n\nWindows\n~~~~~~~\n\nWindows x64 (x86 is similar but needs 32-bit versions of Python package wheels).\n\n* Download and install Python 3.9 / 3.10 / 3.11.\n* Make sure ``python.exe`` / ``pip3.exe`` are in your `PATH`.\n\nThen issue the following commands::\n\n    python -m venv djk-sample\n    cd djk-sample\n    Scripts\\activate.bat\n    python -m pip install -U pip\n    git clone https://github.com/Dmitri-Sintsov/djk-sample.git\n    cd djk-sample\n    rem Uncomment next line to use v2.2.1 instead of development version:\n    rem git checkout tags/v2.2.1\n    python -m pip install -U -r requirements.txt\n\nTo use the current stable `Bootstrap 3`_ version of ``djk_ui``::\n\n    python -m pip install -U -r requirements\\bs3.txt\n\nTo use the current stable `Bootstrap 4`_ version of ``djk_ui``::\n\n    python -m pip install -U -r requirements\\bs4.txt\n\nTo use the development `Bootstrap 3`_ version::\n\n    cli\\3bs.cmd\n\nTo use the development `Bootstrap 4`_ version::\n\n    cli\\4bs.cmd\n\nTo use the development `Bootstrap 5`_ version::\n\n    cli\\5bs.cmd\n\nthen::\n\n    mkdir \"%VIRTUAL_ENV%\\djk-sample\\logs\"\n    mkdir \"%VIRTUAL_ENV%\\djk-sample\\fixtures\"\n    python manage.py makemigrations club_app event_app\n    python manage.py migrate\n    python manage.py compilemessages\n    python manage.py runserver\n\nShell scripts ``cli\\3bs.cmd`` / ``cli\\4bs.cmd`` / ``cli\\5bs.cmd`` allow to switch the Bootstrap version on the fly, using the development\n(not always stable) version of ``djk_ui``.\n\nInstall Deno (optional)\n\nRun PowerShell then invoke::\n\n    irm https://deno.land/install.ps1 | iex\n\n    set DENO_INSTALL=%userprofile%\\.deno\n\nset the environment variable.\n\nMac OS X\n~~~~~~~~\n\nUse brew:\n\n* Install Python3 from https://brew.sh/\n* Follow Ubuntu instructions.\n\nInstall Deno (optional)::\n\n    brew install deno\n\ndeno rollup bundle\n------------------\nSince django-jinja-knockout v2, `django_deno`_ could be used to generate / run Javascript bundle.\n\n`django_deno`_ dependence is optional and is required only to run with old browsers (eg. IE11)\nor to create minimized production mode bundle.\n\n`deno rollup`_ and `system.js`_ are used internally to create / load the production mode bundle.\n\n* Use ``manage.py runrollup`` command to debug with old browsers (eg. IE11)\n* Use ``manage.py collectrollup`` command to create minimized bundle, compatible to old browsers\n* Use ``cli/cherry_django.sh`` to test generated bundle locally (emulation of production).\n\nIt's also possible to generate es6 minimized bundle to use with modern browsers (no IE11), with the following\n``DENO_OUTPUT_MODULE_TYPE`` value in `settings.py`_::\n\n    DENO_OUTPUT_MODULE_TYPE = 'module'\n\nTo automatically create the production Javascript bundle::\n\n    ./cli/collectrollup.sh\n\nTo run test server after the bundle has been created::\n\n    ./cli/cherry_django.sh\n\n`terser`_ is used to minimize the bundle. To create non-minimized bundle, one may turn off terser in `settings.py`_::\n\n    DENO_ROLLUP_COLLECT_OPTIONS = {\n        'terser': False,\n    }\n\n``DJANGO_DEBUG`` and ``CHERRYPY_STATIC`` environment variables are used by `settings.py`_ to select the debug /\nproduction version of Javascript code, for example in the deno production script `cherry_django.sh`_::\n\n    DJANGO_DEBUG='False'\n    CHERRYPY_STATIC='True'\n\nUnit tests\n----------\n\nSelenium tests\n~~~~~~~~~~~~~~\n\nInside project virtual environment install selenium 3.4 or newer::\n\n    pip3 install -r ./requirements/test.txt\n\nTo use `Bootstrap 3`_ version::\n\n    ./cli/3bs.sh\n\nTo use `Bootstrap 4`_ version::\n\n    ./cli/4bs.sh\n\nTo use `Bootstrap 5`_ version::\n\n    ./cli/5bs.sh\n\n``django-jinja-knockout`` version 2.2.1 release tests were performed with:\n\n* Linux fv-az1787-568 6.11.0-1012-azure #12~24.04.1-Ubuntu SMP Mon Mar 10 19:00:39 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux\n* Ubuntu 24.04.2 LTS\n* Python 3.13.3\n* Google Chrome 135.0.7049.114\n* ChromeDriver 135.0.7049.114 (63fd8a7d9d09e41ba37b84386c85d5f249f848f7-refs/branch-heads/7049@{#2175})\n\nSelenium tests (Chrome, interactive)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nPreferable method of interactive running Selenium tests is to use recent version of `Chrome`_ with compatible version of\n`ChromeDriver`_. `ChromeDriver`_ binary should be extracted to one of the ``PATH`` directories or into\n``$VIRTUAL_ENV/bin`` directory.\n\nInstall latest versions of `Chrome`_ / `ChromeDriver`_. Then run the following command::\n\n    DJK_WEBDRIVER='selenium.webdriver.chrome.webdriver' python3 manage.py test\n\nor, simply (will use default Selenium webdriver)::\n\n    python3 manage.py test\n\nClose ``Chrome`` window when the tests are complete. It should print the following message in the console::\n\n    OK\n    Destroying test database for alias 'default'...\n\nSelenium tests (Firefox, interactive)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nNot every version of `Firefox ESR`_ runs Selenium tests successfully due to bugs / incompatibilities of `geckodriver`_,\nso it's not an recommended method to run interactive tests anymore, but one may try.\n\nSelenium 3.0 or newer requires `geckodriver`_ to run with Firefox, which should be extracted to one of the ``PATH``\ndirectories or into ``$VIRTUAL_ENV/bin`` directory.\n\nRun the tests with the following command::\n\n    DJK_WEBDRIVER='selenium.webdriver.firefox.webdriver' python3 manage.py test\n\nSelenium tests (Chrome, remote shell)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nWhen using remote shell, one may install Xvfb::\n\n    apt-get instal xvfb\n\nto run tests in console this way::\n\n    Xvfb :99 \u0026\n    export DISPLAY=:99\n    python3 manage.py test\n\nor this way::\n\n    apt-get instal xvfb\n    export DJK_WEBDRIVER='selenium.webdriver.chrome.webdriver'\n    xvfb-run python3 manage.py test\n\nSee also:\n\n* http://stackoverflow.com/questions/6183276/how-do-i-run-selenium-in-xvfb\n* https://gist.github.com/alonisser/11192482\n\nSelenium tests (headless Chrome)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nEasiest way to run Selenium tests remotely is to use built-in headless Chrome driver. Headless mode is supported by\nrecent versions of Chrome browser::\n\n    DJK_WEBDRIVER='django_jinja_knockout.webdriver.headless_chrome.webdriver' python3 manage.py test\n\nSelenium test (Linux Chromium)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nLinux Chromium usually is updated less often, providing more stable version of browser::\n\n    DJK_WEBDRIVER='django_jinja_knockout.webdriver.chromium.webdriver' python3 manage.py test\n\nTox tests\n~~~~~~~~~\n\nTesting other Python versions with tox.\n\nNote that python 3.5 tests requires tox 2.3.1 or newer version, while Ubuntu 14.04 LTS has older 1.6 version.\nIn such case install newer version of tox in the project virtual environment::\n\n    pip3 install -U tox pip wheel setuptools\n\nTo run the test::\n\n    tox -r -e py36-django-111-bs3\n\nTips\n~~~~\n\nTo skip all or part of already executed tests uncomment one of ``# fixtures =`` definitions located before\n`fixtures_order`_ list in `djk_sample/tests.py`_.\n\nNewly introduced fixtures saved with `dump_data`_ Selenium command should be added in the proper place of\n`fixtures_order`_ list to retain proper loading / checking order of the `has_fixture`_ method.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitri-sintsov%2Fdjk-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitri-sintsov%2Fdjk-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitri-sintsov%2Fdjk-sample/lists"}