Import

Now in order to use our talk_mashup_bot.py functionality in our web application we need to import it into our application.

At the top of app.py (after the from Flask line) add this line:

from talk_mashup_bot import talk_mashup_bot

Now your module is ready to use within your web application.

# app.py

from flask import Flask, render_template, redirect, url_for, jsonify, request
from talk_mashup_bot import talk_mashup_bot

app = Flask(__name__)

@app.route('/')
def hello():
    return "Hello world!"

@app.route('/talk/new')
def new_talk():
    return "An ALA conference title mashup will be here!"

if __name__ == '__main__':
    app.run(debug=True)