def create_app(self):
        app = Flask(__name__)
        app.config["TESTING"] = True
        app.config["CACHE_TYPE"] = "simple"
        app.config["TWITTER_CONSUMER_KEY"] = "twitter_consumer_key"
        app.config["TWITTER_CONSUMER_SECRET"] = "twitter_consumer_secret"
        app.config["TWITTER_ACCESS_TOKEN"] = "twitter_access_token"
        app.config["TWITTER_TOKEN_SECRET"] = "twitter_token_secret"
        self.cache = Cache(app)
        self.twitter_oembedder = TwitterOEmbedder(app, self.cache)

        @app.route("/")
        def index():
            return render_template_string("")

        return app
Example #2
0
from insert_preferences import insert_preferences
from get_preferences import get_preferences
import requests
import json
import datetime

app = Flask(__name__)
app.config.from_object(__name__)
app.secret_key = "any random string"


cache = Cache(app, config={"CACHE_TYPE": "simple"})
twitter_oembedder = TwitterOEmbedder(app, cache, debug=True)
app.config["TWITTER_CONSUMER_KEY"] = "FrTtImImzPxthrIjkTFrsUatY"
app.config["TWITTER_CONSUMER_SECRET"] = "cbPq4hNVEIj87LKcnP4XgCPAdPVc0By8ZVKH7WWVE5H9FS6ihb"
app.config["TWITTER_ACCESS_TOKEN"] = "635902588-6BuJRUYxXQ63vfmQYcP7auLAjkTgxaCRz70MwP5x"
app.config["TWITTER_TOKEN_SECRET"] = "YsLyHMKLoUl47cCge1sBb7KfjDhg2wBbjWhBWm4VVOXtd"


@app.route("/")
# @app.route('/teams/')
def home():

    if "key" in session:
        return render_template("home.html", email=session["key"])
    else:
        return redirect(url_for("login"))


@app.route("/teams/<team_name>/")
def team_name(team_name):