Permalink
Browse files

update README, fix setup.py and provide example usage

  • Loading branch information...
1 parent 93db188 commit edb1d917a1ac870fb063b157b657510a3ccc575c wcdolphin committed Jan 23, 2013
Showing with 27 additions and 3 deletions.
  1. +24 −0 README.md
  2. +1 −1 example.py
  3. +2 −2 setup.py
View
@@ -22,3 +22,27 @@ Install the extension with one of the following commands:
or alternatively if you have pip installed (which you should):
$ 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.
+
+```
+from flask import Flask
+from flask.ext.jsonpify import jsonify
+
+app = Flask(__name__)
+SECRET_KEY = "not actually a secret"
+app.config.from_object(__name__)
+
+
+@app.route("/")
+def index():
+ return jsonify(user="lala")
+
+
+if __name__ == "__main__":
+ app.run(debug=True)
+```
View
@@ -9,7 +9,7 @@
:license: MIT/X11, see LICENSE for more details.
"""
from flask import Flask
-from flask.ext.jsonpify import jsonify
+from flask.ext.jsonpify import jsonify
app = Flask(__name__)
SECRET_KEY = "yeah, not actually a secret"
View
@@ -2,13 +2,13 @@
setup(
- name='Flask-Jsonify',
+ name='Flask-Jsonpify',
version='1.0',
url='https://github.com/wcdolphin/flask-jsonpify',
license='MIT',
author='Cory Dolphin',
author_email='wcdolphin@gmail.com',
- description="A simple Flask extension extending Flask\'s core jsonify"
+ description="A simple Flask extension extending Flask's core jsonify"
" functionality to support JSON-Padded responses, using the callback specified in the querystring",
long_description=__doc__,
py_modules=['flask_jsonpify'],

0 comments on commit edb1d91

Please sign in to comment.