Example #1
0
)

toolbar = flask_debugtoolbar.DebugToolbarExtension(app)
#import auth
import control
import model
import task
import tvshows

from blog.routes import blog

from api import helpers

api_v1 = helpers.Api(app, prefix='/api/v1')

import api.v1

if config.DEVELOPMENT:
    from werkzeug import debug
    try:
        app.wsgi_app = debug.DebuggedApplication(
            app.wsgi_app,
            evalex=True,
            pin_security=False,
        )
    except TypeError:
        app.wsgi_app = debug.DebuggedApplication(app.wsgi_app, evalex=True)
    app.testing = False

app.register_blueprint(blog)
Example #2
0
# Generate test data when running locally
data_dir = os.path.join(os.path.dirname(__file__), 'data')
if not os.path.exists(data_dir):
    import generate_data
    os.mkdir(data_dir)
    generate_data.main(data_dir, 'dummy-password', 'dummy-proof',
                       'dummy-plans')

secrets = json.load(open(os.path.join(data_dir, 'secrets.json')))
index_html = open('index.html').read()
app = flask.Flask(__name__)

# Turn on backtraces, but turn off code execution (that'd be an easy level!)
app.config['PROPAGATE_EXCEPTIONS'] = True
app.wsgi_app = debug.DebuggedApplication(app.wsgi_app, evalex=False)

app.logger.addHandler(logging.StreamHandler(sys.stderr))
# use persistent entropy file for secret_key
app.secret_key = open(os.path.join(data_dir, 'entropy.dat')).read()

# Allow setting url_root if needed
try:
    from local_settings import url_root
except ImportError:
    pass


def absolute_url(path):
    return url_root + path
Example #3
0
from flask import Flask

import os

app = Flask(__name__)
app.debug = "FLASK_DEBUG" in os.environ

app.config.update(
    SITE_NAME=os.environ.get("SITE_NAME", "TedImg"),
    SOURCE_URL="https://git.tedomum.net/kaiyou/tedimg",
    HELP_URL="https://git.tedomum.net/kaiyou/tedimg",
    FULL_STORAGE=os.environ.get("FULL_STORAGE", "/data"),
    THUMB_STORAGE=os.environ.get("THUMB_STORAGE", "/data/thumb"),
    FULL_WEB=os.environ.get("FULL_WEB", "data"),
    THUMB_WEB=os.environ.get("THUMB_WEB", "data/thumb"),
    THUMB_SIZE=100
)

if (app.debug):
    from werkzeug import debug
    app.wsgi_app = debug.DebuggedApplication(app.wsgi_app, True)

import tedimg.views