{ "info": { "author": "Alex Hill", "author_email": "alex@hill.net.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": ".. image:: https://img.shields.io/pypi/v/djpj.svg\n :target: https://pypi.python.org/pypi/DjPj\n.. image:: https://travis-ci.org/AlexHill/djpj.svg?branch=master\n :target: https://travis-ci.org/AlexHill/djpj\n.. image:: https://coveralls.io/repos/github/AlexHill/djpj/badge.svg?branch=master\n :target: https://coveralls.io/github/AlexHill/djpj?branch=master\n\nOverview of DjPj (formerly Django-PJAX-Blocks)\n==============================================\n\nDjPj is a simple, flexible way to add PJAX support to your Django project and\ndeliver a faster browsing experience to users of your website.\n\nIf you don't know what PJAX is, `read about how it works`__ below. In a\nnutshell, it makes navigating between pages on your website faster by loading\nonly the part of the page that needs to change, rather than the whole thing.\nIt's is a well-established technique; if you're reading this on GitHub, you\nprobably loaded this content via PJAX.\n\n__ https://pypi.python.org/pypi/DjPj/#how-does-pjax-work\n\nIn a nutshell, your DjPj-enabled website will respond to PJAX requests with\nthe contents of a single template block of your choosing. It requires no\nchanges to your views, which means it's easy to add PJAX support to\nthird-party Django apps.\n\nGetting started\n===============\n\nPJAX requires cooperation between your front end (the Javascript that runs in\nyour visitors' web browsers) and your Django back end.\n\n1. Set up the front end with jquery-pjax\n----------------------------------------\n\nThe front end is handled by the jquery-pjax library, so first of all, read about\n`how to use jQuery-PJAX`__ and pick one of the techniques there.\n\n__ https://github.com/defunkt/jquery-pjax\n\n2. Install DjPj on your server\n------------------------------\n\nFirst, make sure the views you're PJAXing return TemplateResponse__. DjPj works\nby changing the way your templates are rendered, so it won't work with a\npre-rendered ``HttpResponse``.\n\n__ https://docs.djangoproject.com/en/dev/ref/template-response/\n\nInstall DjPj from PyPI::\n\n > pip install djpj\n\n3. Start using PJAX - basic usage examples\n------------------------------------------\n\nImagine you have a template, ``blog_post.html`` that looks like this::\n\n \n {{ blog_post_title }}\n \n\n ...\n\n
\n {% block blog_post %}\n ...\n {% endblock %}\n \n\nRespond to PJAX requests to ``blog_post_view`` with the contents of the\n\"blog_post\" template block::\n\n @pjax_block(\"blog_post\")\n def blog_post_view(request, ...)\n ...\n return TemplateResponse(request, \"blog_post.html\", context)\n\nIf you want PJAX to correctly update the title of your page, include a\n``title_block`` or ``title_variable`` argument to ``pjax_block``::\n\n @pjax_block(\"blog_post\", title_variable=\"blog_post_title\")\n def blog_post_view(request, ...)\n ...\n\nThe \"container\" in PJAX parlance is the HTML element the contains the content\nyou want to swap out. In the example above, the name of the block is the same\nas the id of the container element - they're both \"blog_post\". In these cases\nyou can just omit the first argument entirely, and DjPj will look for a block\nwhose name is the same as the container's id::\n\n @pjax_block(title_variable-\"blog_post_title\")\n def blog_post_view(request, ...)\n ...\n\nUse DjPj's middleware to enable PJAX without modifying your views\n-----------------------------------------------------------------\n\nIf your site uses third-party views that you can't modify - for example, views\ndefined by an ecommerce or CMS package - you can use DjPj's middleware instead\nof decorating views directly. This can also be handy when you have a number of\nviews that you want to PJAXify which all share a common URL pattern.\n\nHere's what it looks like::\n\n # DjangoPJAXMiddleware should appear last in MIDDLEWARE_CLASSES\n MIDDLEWARE_CLASSES = (\n ...,\n \"djpj.middleware.DjangoPJAXMiddleware\",\n )\n\n DJPJ_PJAX_URLS = (\n ('^/blog/', '@pjax_block(\"blog_post\", title_variable=\"blog_post_title\")'),\n )\n\nEach entry in ``DJPJ_PJAX_URLS`` is a 2-tuple with the first element a regular\nexpression matching the URLs you want to PJAXify, and the second a string\ncontaining Python code defining the decorator, just as it would be done in\nviews.py.\n\nUsing a different template for PJAX requests\n--------------------------------------------\n\nYou can also use a specific template for PJAX requests, instead of returning a\nspecific block. To do this, use the ``pjax_template`` decorator, and pass your\nPJAX template's name as the first argument::\n\n from djpj import pjax_template\n\n @pjax_template(\"pjax_template.html\")\n def my_view(request)\n context = {\"post_title\": \"My First Blog Post\", ...}\n return TemplateResponse(request, \"template.html\", context)\n\nYour template should include a ```` tag if you want the title to be\nupdated in the user's web browser.\n\nCustomising the behaviour of DjPj\n=================================\n\nYou can customise how DjPj selects blocks and templates by supplying your own\nfunctions to the ``pjax_block`` and ``pjax_template`` decorators. `Read more\nabout that on GitHub.`__\n\n__ https://github.com/AlexHill/django-pjax-blocks/blob/master/DOCS.rst\n\n\nHow does PJAX work?\n===================\n\nNormally, when you click a link, your browser has to set up everything from\nscratch: HTML has to be parsed, scripts have to be compiled and executed,\nstylesheets interpreted and applied. It's a lot of work, and when you're\nbrowsing between different pages on the same website, much of this work is\nduplicated. It's like heating up a new skillet for every pancake.\n\nWhen a user clicks a link on your PJAX-enabled website, the server sends only\nthe content that needs to change to display the new page. The fresh dollop of\ncontent drops into place in your page, and the browser doesn't have to do all\nthe work associated with a full page load. To complete the trick, we manipulate\nthe browser history to make the back and forward buttons work normally.\n\n\nAcknowledgements\n================\n\nDjPj relies on defunkt's `jquery-pjax`__ \u2013 the canonical\nclient-side PJAX library and the same one used by GitHub.\n\n__ https://github.com/defunkt/jquery-pjax\n\nDjPj was originally adapted from Jacob Kaplan-Moss' `Django-PJAX`__.\n\n__ https://github.com/jacobian/django-pjax\n\nPython and Django compatibility\n===============================\n\nThis package is tested in Django 1.4+ and Python 2.6, 2.7, 3.3+ and PyPy.\n\nTesting\n=======\n\nTests are run using nose. To install::\n\n pip install nose\n\nAnd to run the tests::\n\n nosetests tests.py", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alexhill/djpj", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "DjPj", "package_url": "https://pypi.org/project/DjPj/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/DjPj/", "project_urls": { "Homepage": "https://github.com/alexhill/djpj" }, "release_url": "https://pypi.org/project/DjPj/0.6.0/", "requires_dist": [ "django (>=1.4)" ], "requires_python": "", "summary": "A template-block-based Django helper for jQuery-PJAX.", "version": "0.6.0" }, "last_serial": 2763576, "releases": { "0.3.0": [ { "comment_text": "", "digests": { "md5": "20eb529a244d7b86f5f9dfca47d0917b", "sha256": "b94a124dbb0ee272673f84938b8fb3d57df6ad1bfd2aaf08507c0d22a53537ae" }, "downloads": -1, "filename": "DjPj-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "20eb529a244d7b86f5f9dfca47d0917b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13924, "upload_time": "2014-08-04T07:44:29", "url": "https://files.pythonhosted.org/packages/23/18/6183643cf73f975bb1f056aa2bc3a1e599e4f954b7dd29053ddd0e8129c6/DjPj-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "47af1b0895140851668da322136d4f79", "sha256": "30b49bd85f1dee8df0e2e01fd974f9a2f8cde8fbbd4cb0fda9c31ddaef2c3052" }, "downloads": -1, "filename": "DjPj-0.3.0.tar.gz", "has_sig": false, "md5_digest": "47af1b0895140851668da322136d4f79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13327, "upload_time": "2014-08-04T07:44:33", "url": "https://files.pythonhosted.org/packages/22/e2/173da14e806f72ca986d296ce57b15098001328d943ff3a8add8e32b13c2/DjPj-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "1e4ea2d20a7ee4ca9502d5db0e8ec623", "sha256": "f2f9160cd715bc4cc851f861f1304b1e3115360b53cf68424c875505184d0d70" }, "downloads": -1, "filename": "DjPj-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1e4ea2d20a7ee4ca9502d5db0e8ec623", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13963, "upload_time": "2014-08-04T07:55:02", "url": "https://files.pythonhosted.org/packages/f7/36/8f16b83a4063142f27c41012df9bda9d46b8fe6c306ac67632337c4ee251/DjPj-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "162a353d422ac60df760114f16e3b135", "sha256": "17b84fb41b28e138567d730f39042f153767c918fc8688edfd90de929b9f17d7" }, "downloads": -1, "filename": "DjPj-0.3.1.tar.gz", "has_sig": false, "md5_digest": "162a353d422ac60df760114f16e3b135", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13350, "upload_time": "2014-08-04T07:55:05", "url": "https://files.pythonhosted.org/packages/33/e4/3d6b42157796bede378fe4994200356b5e39e538f8b56fbcf594d5f21eb3/DjPj-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "2184835c9fcad0735fdb39c6912fa394", "sha256": "24be246e3aafea679886721d4398f9f8d0d9923c22a8f00e1aba65ff3a2fa74e" }, "downloads": -1, "filename": "DjPj-0.3.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2184835c9fcad0735fdb39c6912fa394", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13940, "upload_time": "2014-08-05T01:30:46", "url": "https://files.pythonhosted.org/packages/17/fe/c151690fe544359e042c76b213a333a42612856a554b266d88a13f345807/DjPj-0.3.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d8b1f9d875d257ac909cb240b76f56ca", "sha256": "d80189f4e503f64d2224b1ef523b4104c8fa1bb7ea4028b404bcc28afd202858" }, "downloads": -1, "filename": "DjPj-0.3.2.tar.gz", "has_sig": false, "md5_digest": "d8b1f9d875d257ac909cb240b76f56ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13311, "upload_time": "2014-08-05T01:30:50", "url": "https://files.pythonhosted.org/packages/79/23/86185ed08bb7d10036dd7b64b7075f1ed80d22f6ef2ca98460c60ffb03bb/DjPj-0.3.2.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "5c182f396921312f7c9e3ec6aea8f089", "sha256": "04029fe888f53484bc483a31ec7fc807d408e8f0f567ddf778b0bde5ebf9749b" }, "downloads": -1, "filename": "DjPj-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5c182f396921312f7c9e3ec6aea8f089", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 15919, "upload_time": "2015-04-02T02:03:42", "url": "https://files.pythonhosted.org/packages/7a/f7/a9095c2e2fc502fbd22c151d6e277d759e729bfb36cc00e2586498ea2c7d/DjPj-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b04ffa1ae3423c95b787b125254af436", "sha256": "d2a42bc2642fc93f602288b8b659f895e12e0f666e0b89c8a365390906b61cdc" }, "downloads": -1, "filename": "DjPj-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b04ffa1ae3423c95b787b125254af436", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14975, "upload_time": "2015-04-02T02:03:32", "url": "https://files.pythonhosted.org/packages/49/f1/399aaa9e41d8ae5cab699e08e092c9b3afddddad8776b65878dcce53acba/DjPj-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "02d5a0c87b8ece17f65b5898787f7aa3", "sha256": "9d9186318a2278ce78cafd22a3364b6e40b127e74a87891657c88450f6c73222" }, "downloads": -1, "filename": "DjPj-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "02d5a0c87b8ece17f65b5898787f7aa3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16115, "upload_time": "2016-07-19T08:49:57", "url": "https://files.pythonhosted.org/packages/df/96/6801a4820cfee3813ece2d9614c6be6b31d071eaea7830a0a69efaad0b21/DjPj-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc77bd90b32b2c534842aa8b28c1b5e3", "sha256": "00a94c5fabe71af8a355c0ec204331f4bf0b4c998b380d0b1336de7852959427" }, "downloads": -1, "filename": "DjPj-0.5.0.tar.gz", "has_sig": false, "md5_digest": "fc77bd90b32b2c534842aa8b28c1b5e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15165, "upload_time": "2016-07-19T08:50:00", "url": "https://files.pythonhosted.org/packages/d2/92/9c80f4067f01917b585ec7f3df036cee9979113b0fb7d749d728d2a45d9d/DjPj-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "ec321d726942762fb04730fdd12d4a98", "sha256": "18dd138f77ce69d38421d8135c0bf4cce7ec0d0b90893fbb1dbe919a2ff6dbc7" }, "downloads": -1, "filename": "DjPj-0.6.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec321d726942762fb04730fdd12d4a98", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16294, "upload_time": "2017-04-09T06:20:32", "url": "https://files.pythonhosted.org/packages/58/73/158b4d278eca09adc1f917e9d21f71c5a4ee586d88aa7fae68383ebb51d4/DjPj-0.6.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6110b10225042eb69250d4d42ac68fe2", "sha256": "5178ae930bdc78ca15619d8b33d2d154cf65f95f93e013132023ba80ae3cc6ef" }, "downloads": -1, "filename": "DjPj-0.6.0.tar.gz", "has_sig": false, "md5_digest": "6110b10225042eb69250d4d42ac68fe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15245, "upload_time": "2017-04-09T06:20:35", "url": "https://files.pythonhosted.org/packages/3e/cd/89771a90d8caf899424645b7295580be28332f8a370c5a189ff5282ebebb/DjPj-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ec321d726942762fb04730fdd12d4a98", "sha256": "18dd138f77ce69d38421d8135c0bf4cce7ec0d0b90893fbb1dbe919a2ff6dbc7" }, "downloads": -1, "filename": "DjPj-0.6.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec321d726942762fb04730fdd12d4a98", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16294, "upload_time": "2017-04-09T06:20:32", "url": "https://files.pythonhosted.org/packages/58/73/158b4d278eca09adc1f917e9d21f71c5a4ee586d88aa7fae68383ebb51d4/DjPj-0.6.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6110b10225042eb69250d4d42ac68fe2", "sha256": "5178ae930bdc78ca15619d8b33d2d154cf65f95f93e013132023ba80ae3cc6ef" }, "downloads": -1, "filename": "DjPj-0.6.0.tar.gz", "has_sig": false, "md5_digest": "6110b10225042eb69250d4d42ac68fe2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15245, "upload_time": "2017-04-09T06:20:35", "url": "https://files.pythonhosted.org/packages/3e/cd/89771a90d8caf899424645b7295580be28332f8a370c5a189ff5282ebebb/DjPj-0.6.0.tar.gz" } ] }