Skip to content

Instantly share code, notes, and snippets.

@jnmclarty
Created February 12, 2017 02:19
Show Gist options
  • Save jnmclarty/ed839679f3cf93420689f439c0457eef to your computer and use it in GitHub Desktop.
Save jnmclarty/ed839679f3cf93420689f439c0457eef to your computer and use it in GitHub Desktop.
How to add an endpoint for environment info to any Flask App
import json
# Assuming you've instantiated a Flask app...
from pyenvdiff import Environment
@app.route('/pyenv')
def pyenv():
info = Environment().info()
resp = json.dumps(info)
return Response(resp, status=200, mimetype='application/json')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment