Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)

        def setup_database(run_migrations=False):
    app_config = mg_globals.app_config
    global_config = mg_globals.global_config

    # Load all models for media types (plugins, ...)
    load_models(app_config)
    # Set up the database
    db = setup_connection_and_db_from_config(app_config, run_migrations)
    if run_migrations:
        #Run the migrations to initialize/update the database.
        from mediagoblin.gmg_commands.dbupdate import run_all_migrations
        run_all_migrations(db, app_config, global_config)
    else:
        check_db_migrations_current(db)

    setup_globals(database=db)

    return db
        


src/m/e/mediagoblin-0.6.1/mediagoblin/app.py   mediagoblin(Download)
from mediagoblin.init.celery import setup_celery_from_config
from mediagoblin.init.plugins import setup_plugins
from mediagoblin.init import (get_jinja_loader, get_staticdirector,
    setup_global_and_app_config, setup_locales, setup_workbench, setup_database,
    setup_storage)
 
        # Set up the database
        self.db = setup_database(app_config['run_migrations'])
 
        # Register themes

src/j/o/JoshuaGoblin-HEAD/mediagoblin/app.py   JoshuaGoblin(Download)
from mediagoblin.init.celery import setup_celery_from_config
from mediagoblin.init.plugins import setup_plugins
from mediagoblin.init import (get_jinja_loader, get_staticdirector,
    setup_global_and_app_config, setup_locales, setup_workbench, setup_database,
    setup_storage)
 
        # Set up the database
        self.db = setup_database(app_config['run_migrations'])
 
        # Quit app if need to run dbupdate

src/m/e/mediagoblin-spaetz-0.3.2.dev/mediagoblin/app.py   mediagoblin-spaetz(Download)
from mediagoblin.init.celery import setup_celery_from_config
from mediagoblin.init.plugins import setup_plugins
from mediagoblin.init import (get_jinja_loader, get_staticdirector,
    setup_global_and_app_config, setup_locales, setup_workbench, setup_database,
    setup_storage, setup_beaker_cache)
 
        # Set up the database
        self.connection, self.db = setup_database()
 
        # Register themes