def setup(): global config, cnx, headers config = current_app.config['TWITCH'] cnx = get_db('twitch') headers['Client-ID'] = config['client_id'] if not session.get('access_token'): r = requests.post('https://id.twitch.tv/oauth2/token', params={ 'client_id': config['client_id'], 'client_secret': config['client_secret'], 'grant_type': 'client_credentials' }) session['access_token'] = r.json()['access_token'] headers['Authorization'] = f"Bearer {session['access_token']}"
def setup(): global cnx, config config = current_app.config['BLUEPRINT_NAME'] cnx = get_db('blueprint_name')
def setup(): global cnx cnx = get_db('warframe')
def setup(): global cnx, config config = current_app.config['SLACK'] cnx = get_db('slack') filterwarnings('ignore', category=mysql_warning())
def setup(): global cnx, config, auth config = current_app.config['TWITTER'] cnx = get_db('twitter') auth = OAuth1(config['consumer_key'], config['consumer_secret'], config['access_key'], config['access_secret'])