Skip to content

Commit

Permalink
update README, fix setup.py and provide example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
wcdolphin committed Jan 23, 2013
1 parent 93db188 commit edb1d91
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit edb1d91

Please sign in to comment.