Skip to content

Instantly share code, notes, and snippets.

@return1
Created July 3, 2013 09:29
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save return1/5916637 to your computer and use it in GitHub Desktop.
Save return1/5916637 to your computer and use it in GitHub Desktop.
return a 1px transparent gif with flask
@app.route("/gif")
def gif():
gif = 'R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
gif_str = base64.b64decode(gif)
return send_file(io.BytesIO(gif_str), mimetype='image/gif')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment