Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add import to jsonify example #700

Merged
merged 1 commit into from

3 participants

@SpOOnman

I am new to flask and it took me half an hour to figure out why jsonify doesn't work for me. So answer has pointed out solution for me: http://stackoverflow.com/questions/10727366/jsonify-is-not-defined-internal-server-error . I thought that this import line in example can help out newcomers, like me, in a future.

@untitaker
Collaborator

You might argue that the example is already incomplete because it doesn't contain code to create an app. I'm +0 on this.

@SpOOnman

But you already have an app and add non-working example. Maybe you knew this import already, I didn't since it is not mentioned anywhere.

@kennethreitz
Collaborator

This clarifies things. Thanks!

@kennethreitz kennethreitz merged commit 84958e5 into mitsuhiko:master

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. @SpOOnman
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  flask/json.py
View
2  flask/json.py
@@ -141,6 +141,8 @@ def jsonify(*args, **kwargs):
to this function are the same as to the :class:`dict` constructor.
Example usage::
+
+ from flask import jsonify
@app.route('/_get_current_user')
def get_current_user():
Something went wrong with that request. Please try again.