Flask-Jsonpify
==============
Flask-Jsonpify is an extension to Flask's core jsonify function,
returning JSON-Padded responses when a callback is specified as
request's arguments. It's usage and implementation is the same as
flask.jsonify, differing only when a request has a ``callback``
specified in the request arguments, in which case the response body is
JSON-Padded, or JSONP, using the callback.
To add JSONP support to all routes which previously used flask.jsonify,
simply import jsonify from flask.ext.jsonpify instead of importing it
from flask. The arguments and responses are fully compatible.
Alternatively, import jsonpify from flask.ext.jsonpify to support JSONP
in certain places.
Installation
------------
Install the extension with one of the following commands:
.. code:: bash
$ easy_install flask-jsonpify
or alternatively if you have pip installed (which you should):
.. code:: bash
$ pip install flask-jsonpify
Usage
-----
The best way to use Flask-Jsonpify is to completely replace Flask's
jsonify with this module's jsonify function, as shown below. The method
is fully compatible.
.. code:: Python
from flask import Flask
from flask.ext.jsonpify import jsonify
app = Flask(__name__)
@app.route("/")
def index():
return jsonify(user="lala")
if __name__ == "__main__":
app.run(debug=True)
Raw data
{
"_id": null,
"home_page": "https://github.com/CoryDolphin/flask-jsonpify",
"name": "Flask-Jsonpify",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Cory Dolphin",
"author_email": "corydolph.in@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/60/0f/c389dea3988bffbe32c1a667989914b1cc0bce31b338c8da844d5e42b503/Flask-Jsonpify-1.5.0.tar.gz",
"platform": "any",
"description": "Flask-Jsonpify\n==============\n\nFlask-Jsonpify is an extension to Flask's core jsonify function,\nreturning JSON-Padded responses when a callback is specified as\nrequest's arguments. It's usage and implementation is the same as\nflask.jsonify, differing only when a request has a ``callback``\nspecified in the request arguments, in which case the response body is\nJSON-Padded, or JSONP, using the callback.\n\nTo add JSONP support to all routes which previously used flask.jsonify,\nsimply import jsonify from flask.ext.jsonpify instead of importing it\nfrom flask. The arguments and responses are fully compatible.\nAlternatively, import jsonpify from flask.ext.jsonpify to support JSONP\nin certain places.\n\nInstallation\n------------\n\nInstall the extension with one of the following commands:\n\n.. code:: bash\n\n $ easy_install flask-jsonpify\n\nor alternatively if you have pip installed (which you should):\n\n.. code:: bash\n\n $ pip install flask-jsonpify\n\nUsage\n-----\n\nThe best way to use Flask-Jsonpify is to completely replace Flask's\njsonify with this module's jsonify function, as shown below. The method\nis fully compatible.\n\n.. code:: Python\n\n from flask import Flask\n from flask.ext.jsonpify import jsonify\n\n app = Flask(__name__)\n\n @app.route(\"/\")\n def index():\n return jsonify(user=\"lala\")\n\n\n if __name__ == \"__main__\":\n app.run(debug=True)",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Flask extension adding a decorator for JSONP support",
"version": "1.5.0",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/CoryDolphin/flask-jsonpify"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "600fc389dea3988bffbe32c1a667989914b1cc0bce31b338c8da844d5e42b503",
"md5": "8a10e37942c43d93d107644a3fe77d98",
"sha256": "8ac4c732aa5b11d9f6c2de58065d3b669f139518ca8f529bce943817e2fedbfb"
},
"downloads": -1,
"filename": "Flask-Jsonpify-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "8a10e37942c43d93d107644a3fe77d98",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2974,
"upload_time": "2015-02-12T05:46:44",
"upload_time_iso_8601": "2015-02-12T05:46:44.067768Z",
"url": "https://files.pythonhosted.org/packages/60/0f/c389dea3988bffbe32c1a667989914b1cc0bce31b338c8da844d5e42b503/Flask-Jsonpify-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2015-02-12 05:46:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CoryDolphin",
"github_project": "flask-jsonpify",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "flask-jsonpify"
}