def get_app(self): cfg = Config(SECURITY_KEY='MYKEY') cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = storage_path cfg.ALLOW_UNSAFE_URL = False cfg.ALLOW_OLD_URLS = True cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True importer = Importer(cfg) importer.import_modules() server = ServerParameters(8891, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'MYKEY' ctx = Context(server, cfg, importer) application = ThumborServiceApp(ctx) storage = FileStorage(Context(config=cfg, server=server)) # Store fixtures (image.jpg and image.txt) into the file storage storage.put('image.jpg', file(join(storage_path, 'image.jpg')).read()) storage.put_crypto( 'image.jpg' ) # Write a file on the file storage containing the security key return application
def get_context(self): cfg = Config(SECURITY_KEY='ACME-SEC') cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = self.loader_path cfg.ALLOW_UNSAFE_URL = False importer = Importer(cfg) importer.import_modules() server = ServerParameters(8890, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'ACME-SEC' return Context(server, cfg, importer)
def get_app(self): cfg = Config(SECURITY_KEY="ACME-SEC") cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = storage_path cfg.ALLOW_UNSAFE_URL = False importer = Importer(cfg) importer.import_modules() server = ServerParameters(8890, "localhost", "thumbor.conf", None, "info", None) server.security_key = "ACME-SEC" ctx = Context(server, cfg, importer) application = ThumborServiceApp(ctx) return application
def get_app(self): cfg = Config(SECURITY_KEY='ACME-SEC') cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = storage_path cfg.ALLOW_UNSAFE_URL = False cfg.ALLOW_OLD_URLS = True importer = Importer(cfg) importer.import_modules() server = ServerParameters(8890, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'ACME-SEC' ctx = Context(server, cfg, importer) application = ThumborServiceApp(ctx) return application
def get_context(self): cfg = Config(SECURITY_KEY='MYKEY') cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = self.loader_path cfg.ALLOW_UNSAFE_URL = False cfg.ALLOW_OLD_URLS = True cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True cfg.STORAGE = 'thumbor.storages.file_storage' cfg.STORAGE_FILE_STORAGE_ROOT_PATH = self.root_path importer = Importer(cfg) importer.import_modules() server = ServerParameters(8891, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'MYKEY' return Context(server, cfg, importer)
def get_context(self): cfg = Config(SECURITY_KEY="MYKEY") cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = self.loader_path cfg.ALLOW_UNSAFE_URL = False cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True cfg.STORAGE = "thumbor.storages.file_storage" cfg.STORAGE_FILE_STORAGE_ROOT_PATH = self.root_path importer = Importer(cfg) importer.import_modules() server = ServerParameters(8891, "localhost", "thumbor.conf", None, "info", None) server.security_key = "MYKEY" return Context(server, cfg, importer)
def get_app(self): cfg = Config(SECURITY_KEY='ACME-SEC') cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = storage_path cfg.ALLOW_UNSAFE_URL = False cfg.ALLOW_OLD_URLS = True cfg.STORAGE="thumbor.storages.file_storage" cfg.FILE_STORAGE_ROOT_PATH=storage_path cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True importer = Importer(cfg) importer.import_modules() server = ServerParameters(8891, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'ACME-SEC' ctx = Context(server, cfg, importer) application = ThumborServiceApp(ctx) return application
def get_app(self): cfg = Config(SECURITY_KEY='MYKEY') cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = storage_path cfg.ALLOW_UNSAFE_URL = False cfg.ALLOW_OLD_URLS = True cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True importer = Importer(cfg) importer.import_modules() server = ServerParameters(8891, 'localhost', 'thumbor.conf', None, 'info', None) server.security_key = 'MYKEY' ctx = Context(server, cfg, importer) application = ThumborServiceApp(ctx) storage = FileStorage(Context(config=cfg, server=server)) # Store fixtures (image.jpg and image.txt) into the file storage storage.put('image.jpg', open(join(storage_path, 'image.jpg')).read()) storage.put_crypto('image.jpg') # Write a file on the file storage containing the security key return application
def get_app(self): cfg = Config(SECURITY_KEY="MYKEY") cfg.LOADER = "thumbor.loaders.file_loader" cfg.FILE_LOADER_ROOT_PATH = storage_path cfg.ALLOW_UNSAFE_URL = False cfg.ALLOW_OLD_URLS = True cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True importer = Importer(cfg) importer.import_modules() server = ServerParameters(8891, "localhost", "thumbor.conf", None, "info", None) server.security_key = "MYKEY" ctx = Context(server, cfg, importer) application = ThumborServiceApp(ctx) logger.exception = Mock() storage = FileStorage(Context(config=cfg, server=server)) # Store fixtures (image.jpg and image.txt) into the file storage storage.put_crypto("image.jpg") # Write a file on the file storage containing the security key return application