{ "info": { "author": "Rhys Elsmore", "author_email": "me@rhys.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-PJAX\n==========\n\n\n.. image:: https://travis-ci.org/rhyselsmore/flask-pjax.png?branch=master\n :target: https://travis-ci.org/rhyselsmore/flask-pjax\n\n.. image:: https://pypip.in/d/Flask-PJAX/badge.png\n :target: https://crate.io/packages/Flask-PJAX/\n\nAdd a fairly basic handler for PJAX to Flask.\n\nAllows you to specify a base template for both a normal request or a\nPJAX request. This allows you to return the required code blocks, and\nchoose what you wish to render.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install flask-pjax\n\nConfiguration\n-------------\n\nConfigiguring Flask-PJAX is fairly simple. To get started, initalise it against\nyour application.\n\n.. code-block:: python\n\n from flask import Flask\n from flask_pjax import PJAX\n\n app = Flask(__name__)\n PJAX(app)\n\nor\n\n.. code-block:: python\n\n from flask import Flask\n from flask_pjax import PJAX\n\n app = Flask(__name__)\n pjax = PJAX(app)\n\nor\n\n.. code-block:: python\n\n from flask import Flask\n from flask_pjax import PJAX\n\n pjax = PJAX()\n\n def create_app():\n app = Flask(__name__)\n pjax.init_app(app)\n return app\n\nCurrently, the base template for your PJAX request is the only configuration\nitem. This is set to the location of the template within your project.\n\n.. code-block:: python\n\n PJAX_BASE_TEMPLATE = \"pjax.html\"\n\nUsage\n-----\n\nYou can return your templates like you normally do.\n\n.. code-block:: python\n\n # app.py\n\n @app.route('/')\n def index():\n return render_template('index.html')\n\nYour base template remains the same.\n\n.. code-block:: html\n\n # base.html\n\n \n
\n