Skip to content

Instantly share code, notes, and snippets.

@jassinm
Created June 6, 2012 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jassinm/2884734 to your computer and use it in GitHub Desktop.
Save jassinm/2884734 to your computer and use it in GitHub Desktop.
dumps a json including dates
dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime.datetime) else None
def jsonify(data):
return Response(json.dumps(data, default=dthandler))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment