I have a small "Hello World" Flask script that takes an output from a program, called rescuetime_api and puts it on a URL /blog. I wanted to run the script in Debug mode and hard-coded it into the top of my program but I was wondering if there is a way to pass this value through from my Bash shell. Thanks in advance for your help.
#Flask tutorial
import rescuetime_api as api
import os
from flask import Flask
app = Flask(__name__)
DEBUG = True
@app.route("/")
def hello():
return "This is my homepage!"
@app.route("/blog")
def blog():
result = api.download_rescuetime_json()[1][1]
return "%s" % result
if __name__ == "__main__":
if os.environ.get("FLASK_TUTORIAL_DEBUG"):
DEBUG = True
print "Running in debug:", DEBUG
app.run(debug=DEBUG)