I have a Python Flask app that accesses the Github API. For this I need to store an access token. What is the common practice to store that data and how do I access that inside my app?
from flask import Flask, request
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route('/',methods=['POST'])
def foo():
...
Best answer
The simpliest way is to place it into configuration module (regular python .py
file) and then import
and use it in your code as suggested by this snippet on Flask site.