{ "info": { "author": "Diego J. Romero L\u00f3pez", "author_email": "diegojromerolopez@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "License :: OSI Approved :: MIT License" ], "description": "django-async-include\n====================\n\nAsynchronous inclusion of Django templates\n\nWhat\u2019s this?\n============\n\nThis is a project to help the ajax load of chunks of HTML with minimal\neffort on the developer side, providing an easy way to improve web-site\nexperience for your users by minimizing perceived loading times.\n\n`This is the development\nrepository `__.\n\nHow does it work?\n=================\n\nThe async_include template tag sends the context to the server using an\nAJAX request.\n\nIn the case of model objects, it sends the model, application and id. In\nthe case of QuerySets, it sends the encrypted parametriced SQL. Of\ncourse, in the case of safe values like strings, booleans or numbers\nthis data are send \u201cas is\u201d.\n\nThe receiver is a basic view of this application that renders the\ntemplate with the received context and returns it in the AJAX call.\n\nRequirements\n============\n\nThis application only depends on\n`pycryptodome `__ and\n`jsonpickle `__.\n\nOf course you will need `Django `__\nversion 1.10 or newer. I have no tested in lower versions of Django but\nit should work fine with versions from 1.8 to 1.9.\n\njQuery\n------\n\nHaving said that, this application needs\n`jQuery `__ to fetch the templates. So make sure\nyou have jquery loaded in your HEAD HTML section.\n\nThe easiest way of inclue jQuery in your project is by `loading it from\na CDN `__:\n\n.. code:: html\n\n \n\nBeware of the version of jQuery if you are using bootstrap or other\nframework that can\u2019t work with jQuery\u2019s last version.\n\nFontawesome (optional)\n----------------------\n\n`Fontawesome `__ is the the-facto standard of\nfont icons of our time. Include it in your project to see the spinner\nmoving when loading the remote templates.\n\nThe easiest way to include it by using a CDN. For example, `bootstrap\nCDN `__ (not afiliated nor\nthey endorse this project) is one of the most known.\n\nDefault waiting spinner uses fontawesome. You can overwrite\n**async_include/spinner.html** template if don\u2019t want to use the default\nfontawesome style.\n\nInstallation\n============\n\nUsing pip\n---------\n\n`This package is in\npypi `__ so you only\nhave to write:\n\n.. code:: sh\n\n pip install django-async-include\n\nto install it.\n\nInstall master version\n----------------------\n\nInclude this code in your requirements.txt file:\n\n.. code:: sh\n\n -e git://github.com/diegojromerolopez/django-async-include.git#egg=django_async_include\n\nInstallation in your Django project\n-----------------------------------\n\nInclude the application in your project\u2019s **settings.py**:\n\n.. code:: sh\n\n\n INSTALLED_APPS = [\n ## ...\n 'async_include',\n ]\n\nInclude django-async-include URLs\n---------------------------------\n\nInclude the URLs of Django-Async-Include in your **urls.py** project in\nthe namespace **async_include**:\n\n.. code:: python\n\n urlpatterns = [\n # ...\n url(r'^async_include/', include('async_include.urls', namespace=\"async_include\")),\n ]\n\nUse\n===\n\nLoad the **async_include** template tags at the top of your file and use\nthe **async_include** template tag as a replacement of the django\ninclude template tag.\n\nYou have to pass the local context explicitily to the async included\ntemplates, so you can pass all variables you need in your included\ntemplate as named parameters of the **async_include** template tag.\n\n.. code:: html\n\n\n {# Load the async_include template tag at the top of your template file #}\n {% load async_include %}\n\n {# Call the async_include template tag indicating what objects needs to replace it #}\n {% async_include \"\" = = ... = %}\n\nWarning and limitations\n-----------------------\n\nObject dynamic attributes\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nNo dynamic attribute will be passed to the templates given that only a\nreference to it is passed from the caller to the included template\ncallee. **Don\u2019t use dynamic attributes inside an async_included\ntemplate**.\n\nHowewer, the full object will be passed to the async_included template,\nso you could call its methods and properties without any problem.\n\nQuerySets\n~~~~~~~~~\n\nEach QuerySet is passed as encrypted SQL and converted on the receiver\nto a RawQuerySet.\n\nRawQuerySet has no **len** method so length filter returns allways 0.\n\nTo fix this we have implemented a new version of the length filter that\nwill be loaded in your template if you overwrite\n\n.. code:: html\n\n {% load async_included %}\n\nNote that this templatetag file is **async_included**, ending in **ed**.\n\nExamples\n--------\n\nPasing an object\n~~~~~~~~~~~~~~~~\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {# Load the template and informs the board object is required for the included template #}\n {% async_include \"boards/components/view/current_percentage_of_completion.html\" board=board %}\n\nPasing a QuerySet\n~~~~~~~~~~~~~~~~~\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {% async_include \"boards/components/view/summary.html\" board=board member=member next_due_date_cards=next_due_date_cards %}\n\nCustomization\n=============\n\nSpinner\n-------\n\nOverwrite **async_include/spinner.html** template if you want to change\nthe spinner from fontawesome one (default) by a background image or a\nimage. Otherwise, make sure you are loading fontawesome fonts.\n\nNote that the spinner must have class **async_included-spinner**.\nOtherwise spinner behavior is going to be impredictable.\n\nShow/Hide spinner\n~~~~~~~~~~~~~~~~~\n\nIncluding the optional parameter \\**spinner__visible=False*\\* when\ncalling the async_include template tag will not show the spinner block.\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {# Will not show the spinner #}\n {% async_include \"boards/components/view/last_comments.html\" board=board spinner__visible=False %}\n\nCustomize spinner template per async_include template tag call\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nUse the optional parameter \\**spinner__template_path*\\* to set a\ndiferrent template path for an specific async_include call in your\ntemplates.\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {# Will not show the spinner #}\n {% async_include \"boards/components/view/last_comments.html\" board=board spinner__template_path=\"templates/comments/last_comments_spinner.html\" %}\n\nRemember the spinner tag should contain the **async_included-spinner**\nclass.\n\nBlock wrapper html tag\n----------------------\n\nWrapper tag is **div** and maybe you don\u2019t want that. Set\n\\**html__tag*\\* optional parameter to the name of the tag you need in\nthat particular context.\n\nExample:\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {# Will be replaced by
  • block insted of
    #}\n {% async_include \"boards/components/view/last_comments.html\" board=board html__tag='li' %}\n\nBlock wrapper html tag class\n----------------------------\n\nCustomize the wrapper class by passing \\**html__tag__class*\\* optional\nparameter to the template tag.\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {# Will be replaced by
  • block insted of
    #}\n {# Class last_comments will be added to wrapper class #}\n {% async_include \"boards/components/view/last_comments.html\" board=board html__tag='li' html__tag__class='last_comments' %}\n\n##\u00a0Request frequency\n\nIf do you want to make frequent requests, set request__frequency to the\nnumber of seconds you want to make the requests.\n\nExample:\n\n.. code:: html\n\n {% load async_include %}\n\n {# .. #}\n\n {# Upate the last comments each 60 seconds #}\n {% async_include \"boards/components/view/last_comments.html\" board=board request__frequency=60 %}\n\nMain author\n===========\n\nDiego J. Romero-L\u00f3pez is a Software Engineer at\n`Drivies `__.\n\nThis project is in no way endorsed or related in any way to my past or\ncurrent employers.\n\nContact me by email at diegojREMOVETHISromerolopezREMOVETHIS@gmail.com.\n\nContributors\n============\n\n- `Erik Telepovsk\u00fd `__:\n\n - Bug fixes.\n - Modern mobile browser support.\n - PyPy configuration fixes.\n - Python3 support.\n - Multi language support.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/diegojromerolopez/django-async-include", "keywords": "django template asynchronous template_tag", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-async-include", "package_url": "https://pypi.org/project/django-async-include/", "platform": "", "project_url": "https://pypi.org/project/django-async-include/", "project_urls": { "Homepage": "https://github.com/diegojromerolopez/django-async-include" }, "release_url": "https://pypi.org/project/django-async-include/0.6.5/", "requires_dist": null, "requires_python": "", "summary": "A simple application for Django to include (and fetch) asynchronous templates.", "version": "0.6.5" }, "last_serial": 3550831, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "be0b5c9604c0a26bb716c52e451d3457", "sha256": "738ba3724ae67fffac7aee902f0ab3215fa1fa9815ac4434469de242323cfd7a" }, "downloads": -1, "filename": "django-async-include-0.1.tar.gz", "has_sig": false, "md5_digest": "be0b5c9604c0a26bb716c52e451d3457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8837, "upload_time": "2017-03-01T16:11:33", "url": "https://files.pythonhosted.org/packages/59/78/848d7b981c4b2659143c3f23ba6e1a1fe0076531fcb3376f0b754b5d5d53/django-async-include-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "cde01b731b1b784f841d96c25829fab9", "sha256": "f82ba1135d44bce478c2f0e495de9fd84dc73b5ea77c8bd3650746a377335a86" }, "downloads": -1, "filename": "django-async-include-0.2.tar.gz", "has_sig": false, "md5_digest": "cde01b731b1b784f841d96c25829fab9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19240, "upload_time": "2017-03-17T17:39:43", "url": "https://files.pythonhosted.org/packages/58/cf/66ed03292c439bad5314b7e9359ae5a944693a7b62d37b7fbea0a2571eae/django-async-include-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "3a273b907003758be178e3288769af44", "sha256": "d8a78851df610d112bf56e0d7448e1c136143a3e577fa2e5e01c13807d794ba9" }, "downloads": -1, "filename": "django-async-include-0.3.tar.gz", "has_sig": false, "md5_digest": "3a273b907003758be178e3288769af44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 61780, "upload_time": "2017-03-20T17:14:46", "url": "https://files.pythonhosted.org/packages/0b/f5/7b1e45ad0f3b03d3cab29d468b28498dc1dae24f109f3283cf6499675f10/django-async-include-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "bae48fe6d264a5a514cbbc33695866d6", "sha256": "c896f03f60c4be291cdb06fb95270f8df6f866cd083b0e875b040256777c5bb6" }, "downloads": -1, "filename": "django-async-include-0.4.tar.gz", "has_sig": false, "md5_digest": "bae48fe6d264a5a514cbbc33695866d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 124148, "upload_time": "2017-03-28T16:28:15", "url": "https://files.pythonhosted.org/packages/47/40/75082b02502a5f63d075706f9896db21a2de0b36ef575b868a4368d6ed29/django-async-include-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "757eedbc8bdae00272ab5f16bf4dc34b", "sha256": "9801fa46b3bcea569e0dd366a23eaf1f4d1a34bab8f0ad9829f99d60eff2a31f" }, "downloads": -1, "filename": "django-async-include-0.5.tar.gz", "has_sig": false, "md5_digest": "757eedbc8bdae00272ab5f16bf4dc34b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12315, "upload_time": "2017-04-17T15:02:55", "url": "https://files.pythonhosted.org/packages/00/dc/fa900dc551372b30b14210b808274c9060e86f389257225f793b98765216/django-async-include-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "3a2f3237041813e4cc759c659affdd6e", "sha256": "d145d1b2a7dff679341243aa485099e182741beebae4e00bc5e0aad65c1ffd1a" }, "downloads": -1, "filename": "django-async-include-0.5.1.tar.gz", "has_sig": false, "md5_digest": "3a2f3237041813e4cc759c659affdd6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12479, "upload_time": "2017-05-29T15:39:21", "url": "https://files.pythonhosted.org/packages/17/1d/9d6ecfebab50b0d96abc429e6c7ad32c827ebfaf3e3276b0b577e8e3715e/django-async-include-0.5.1.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "50c9340696a31303e5e954088f1c5a33", "sha256": "a52693db2fbb8d9b576827aae11606829243f3dc1326f6cd725b6ff94648d080" }, "downloads": -1, "filename": "django-async-include-0.5.3.tar.gz", "has_sig": false, "md5_digest": "50c9340696a31303e5e954088f1c5a33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10448142, "upload_time": "2018-02-03T12:54:37", "url": "https://files.pythonhosted.org/packages/b5/d4/bc710011f7e84b4e9d54b1e9d81f8e0ffbe9be3f8d12b30a3a4a24a5a5d5/django-async-include-0.5.3.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "0f06669feecb4f4258b66d97ff256f0f", "sha256": "20b8d8ce4d65b0292d3c5daf89ea5526a31fb10cd652c1e592955c5a5cd0e120" }, "downloads": -1, "filename": "django-async-include-0.6.tar.gz", "has_sig": false, "md5_digest": "0f06669feecb4f4258b66d97ff256f0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10564481, "upload_time": "2018-02-03T13:13:52", "url": "https://files.pythonhosted.org/packages/e1/a4/d2e9c32a4f0bd0cea70bbee54be1ca641b8a63a8b65e87bce7dc940698c5/django-async-include-0.6.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "9f31e209c8d98bc02aacee76f394e258", "sha256": "e7bc071d8801695a15c0453fe328c9ac0a0d61b5a5c00293e6c422441bed830e" }, "downloads": -1, "filename": "django-async-include-0.6.1.tar.gz", "has_sig": false, "md5_digest": "9f31e209c8d98bc02aacee76f394e258", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10580632, "upload_time": "2018-02-03T13:20:07", "url": "https://files.pythonhosted.org/packages/42/81/34c74d409a095b72fcca30f83c61f9df46fd34cd2a8e65ee318e2f9f0b8e/django-async-include-0.6.1.tar.gz" } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "b05484150e9daaaa95e2041118535d67", "sha256": "de5074b9f1c6097a11cd8bfb49640ebfe4cf56caaedd7d3bcfeea83137996550" }, "downloads": -1, "filename": "django-async-include-0.6.4.tar.gz", "has_sig": false, "md5_digest": "b05484150e9daaaa95e2041118535d67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11823, "upload_time": "2018-02-04T10:50:33", "url": "https://files.pythonhosted.org/packages/b0/1c/1d3dd7bf41b7f7e77d5b9856b201cb9e7ef21c267603dd95cc7401deb319/django-async-include-0.6.4.tar.gz" } ], "0.6.5": [ { "comment_text": "", "digests": { "md5": "47fc4e2fac7c18ec51dd44ce32277324", "sha256": "12f888da1f924bb61fce589a4e0cc4758363dd912d0e60eca7dc48169c4f7af3" }, "downloads": -1, "filename": "django-async-include-0.6.5.tar.gz", "has_sig": false, "md5_digest": "47fc4e2fac7c18ec51dd44ce32277324", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12317, "upload_time": "2018-02-04T17:48:55", "url": "https://files.pythonhosted.org/packages/89/f5/480191bad97ec9b22d0841667659a0cec865199760940d7787fb46ce3cfb/django-async-include-0.6.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47fc4e2fac7c18ec51dd44ce32277324", "sha256": "12f888da1f924bb61fce589a4e0cc4758363dd912d0e60eca7dc48169c4f7af3" }, "downloads": -1, "filename": "django-async-include-0.6.5.tar.gz", "has_sig": false, "md5_digest": "47fc4e2fac7c18ec51dd44ce32277324", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12317, "upload_time": "2018-02-04T17:48:55", "url": "https://files.pythonhosted.org/packages/89/f5/480191bad97ec9b22d0841667659a0cec865199760940d7787fb46ce3cfb/django-async-include-0.6.5.tar.gz" } ] }