Skip to content

Instantly share code, notes, and snippets.

@bodik
Forked from carc1n0gen/flask-domain-matching.py
Last active February 22, 2021 09:10
Show Gist options
  • Save bodik/3d62e88075cedcea72f3fe7869d49d32 to your computer and use it in GitHub Desktop.
Save bodik/3d62e88075cedcea72f3fe7869d49d32 to your computer and use it in GitHub Desktop.
Flask Graph Image
from flask import Flask, send_file, url_for
app = Flask(__name__)
@app.route('/page1')
def page1():
# would be a render_template() at last
return '<img src="' + url_for('image1') + '">'
@app.route('/image1')
def image1():
# do magic here with https://www.kaggle.com/kmader/visualizing-graph-traversal
return send_file('produced_file.gif', mimetype='image/gif')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment