Source

yt.hub / ythub / __init__.py

from flask import Flask, g, session
from flaskext.gravatar import Gravatar
from ythub.local_config import secret_key
import os

app = Flask(__name__)
app.secret_key = secret_key
app.config['MAX_CONTENT_LENGTH'] = 1024*1024*1024

gravatar = Gravatar(app,
                    size=80,
                    rating='g',
                    default='MysteryMan',
                    force_default=False,
                    force_lower=False)

import ythub.views, ythub.hub_api
from ythub.models import User
from ythub.database import db_session
from ythub.hub_api import api

app.register_blueprint(api, url_prefix="/api")

from flaskext.login import LoginManager
login_manager = LoginManager()
login_manager.setup_app(app)

@app.teardown_request
def shutdown_session(exception=None):
    db_session.remove()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.