def init_db(): top_folder = os.path.dirname(pypi_vm.app.__file__) rel_file = os.path.join('db', 'pypi.sqlite') db_file = os.path.join(top_folder, rel_file) DbSession.global_init(db_file)
def init_db(): db_file = os.path.abspath( os.path.join(os.path.dirname(__file__), 'db', 'pypi.sqlite')) DbSession.global_init(db_file)