Ejemplo n.º 1
0
def resetdb_command():
    """
    Open a database shell.
    """
    call_command('reset_db')
    call_command('syncdb', interactive=False)
    from codenode.frontend.backend.fixtures.development import run as bootstrap_database
    bootstrap_database()
Ejemplo n.º 2
0
def resetdb_command():
    """
    Open a database shell.
    """
    call_command('reset_db')
    call_command('syncdb', interactive=False)
    from codenode.frontend.backend.fixtures.development import run as bootstrap_database
    bootstrap_database()
Ejemplo n.º 3
0
 def check_home_dir(self, path):
     """ check an environment directory contains a database and search index, etc."""
     
     if not os.path.exists(path):
         os.mkdir(path)
     
     if not os.path.exists(settings.DATABASE_NAME):
         call_command('syncdb', interactive=False)
         bootstrap_database()
         
     # a check for database schema version should go in here
     
     search.create_index()
Ejemplo n.º 4
0
def check_home_dir():
    """
    Check an environment directory contains a database and search index, etc. and required directories.
    """
    # non top level imports to prevent django settings setup before we have handled it
    from django.conf import settings
    from codenode.frontend.backend.fixtures.development import run as bootstrap_database
    from codenode.frontend.search import search

    for required_directory in [settings.HOME_PATH, settings.PLOT_IMAGES]:
        if not os.path.exists(required_directory):
            os.mkdir(required_directory)

    if not os.path.exists(settings.DATABASE_NAME):
        call_command('syncdb', interactive=False)
        bootstrap_database()

    # a check for database schema version should go in here

    search.create_index()
Ejemplo n.º 5
0
def check_home_dir():
    """
    Check an environment directory contains a database and search index, etc. and required directories.
    """
    # non top level imports to prevent django settings setup before we have handled it
    from django.conf import settings
    from codenode.frontend.backend.fixtures.development import run as bootstrap_database
    from codenode.frontend.search import search
    
    for required_directory in [
            settings.HOME_PATH,
            settings.PLOT_IMAGES
        ]:
        if not os.path.exists(required_directory):
            os.mkdir(required_directory)
        
    if not os.path.exists(settings.DATABASES['default']['NAME']): #'default'?
        call_command('syncdb', interactive=False)
        bootstrap_database()
        
    # a check for database schema version should go in here
    
    search.create_index()
Ejemplo n.º 6
0
def bootstrapdb_command():
    """
    Load default codenode setup: an admin user, and a local backend with a python engine.
    """
    from codenode.frontend.backend.fixtures.development import run as bootstrap_database
    bootstrap_database()
Ejemplo n.º 7
0
def bootstrapdb_command():
    """
    Load default codenode setup: an admin user, and a local backend with a python engine.
    """
    from codenode.frontend.backend.fixtures.development import run as bootstrap_database
    bootstrap_database()