Skip to content

Commit

Permalink
Load video json into Flask app
Browse files Browse the repository at this point in the history
  • Loading branch information
georgevreilly committed Feb 2, 2013
1 parent 3e23120 commit f11c3fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions gae_flask_app/app.py
@@ -1,11 +1,17 @@
from __future__ import absolute_import

from flask import Flask from flask import Flask
from gae_flask_app.videos import load_video_json
import logging


def create_app(config): def create_app(config):
app = Flask(__name__) app = Flask(__name__)
app.config.from_object(config) app.config.from_object(config)
json_filename = app.config['VIDEO_JSON']
vj = load_video_json(json_filename)
logging.info("Loaded video data from '%s'", json_filename)


# Later register blueprints here. # Register blueprints here.
# ...
from gae_flask_app.hello_gae import hello_gae from gae_flask_app.hello_gae import hello_gae
app.register_blueprint(hello_gae, url_prefix="/") app.register_blueprint(hello_gae, url_prefix="/")
return app return app
3 changes: 2 additions & 1 deletion gae_flask_app/settings.py
@@ -1 +1,2 @@
DEBUG=True DEBUG=True # True => Security Hole
VIDEO_JSON="test-videos.json"

0 comments on commit f11c3fe

Please sign in to comment.