本文整理汇总了Python中thumbor.config.Config.FILE_STORAGE_ROOT_PATH方法的典型用法代码示例。如果您正苦于以下问题:Python Config.FILE_STORAGE_ROOT_PATH方法的具体用法?Python Config.FILE_STORAGE_ROOT_PATH怎么用?Python Config.FILE_STORAGE_ROOT_PATH使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thumbor.config.Config
的用法示例。
在下文中一共展示了Config.FILE_STORAGE_ROOT_PATH方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_context
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_context(self):
cfg = Config(SECURITY_KEY='ACME-SEC')
cfg.LOADER = "thumbor.loaders.http_loader"
cfg.STORAGE = "thumbor.storages.file_storage"
cfg.FILE_STORAGE_ROOT_PATH = self.root_path
importer = Importer(cfg)
importer.import_modules()
server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', None)
server.security_key = 'ACME-SEC'
return Context(server, cfg, importer)
示例2: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
cfg = Config()
cfg.ENABLE_ORIGINAL_PHOTO_UPLOAD = True
cfg.ORIGINAL_PHOTO_STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = storage_path
cfg.ALLOW_ORIGINAL_PHOTO_DELETION = False
importer = Importer(cfg)
importer.import_modules()
ctx = Context(None, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例3: get_context
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
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.STORAGE = "thumbor.storages.file_storage"
cfg.FILE_STORAGE_ROOT_PATH = self.root_path
importer = Importer(cfg)
importer.import_modules()
server = ServerParameters(8889, "localhost", "thumbor.conf", None, "info", None)
server.security_key = "ACME-SEC"
return Context(server, cfg, importer)
示例4: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
cfg = Config()
cfg.UPLOAD_ENABLED = True
cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
cfg.UPLOAD_DELETE_ALLOWED = False
importer = Importer(cfg)
importer.import_modules()
ctx = Context(None, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例5: get_context
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_context(self):
file_storage_root_path = '/tmp/thumbor/storage'
if exists(file_storage_root_path):
rmtree(file_storage_root_path)
cfg = Config()
cfg.USE_BLACKLIST = True
cfg.LOADER = "thumbor.loaders.file_loader"
cfg.FILE_LOADER_ROOT_PATH = abspath(join(dirname(__file__), '../fixtures/images/'))
cfg.STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
importer = Importer(cfg)
importer.import_modules()
return Context(None, cfg, importer)
示例6: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
cfg = Config()
cfg.UPLOAD_ENABLED = True
cfg.UPLOAD_PUT_ALLOWED = True
cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = storage_path
cfg.MIN_WIDTH = 40
cfg.MIN_HEIGHT = 40
importer = Importer(cfg)
importer.import_modules()
ctx = Context(None, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例7: get_context
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_context(self):
self.default_filename = 'image'
cfg = Config()
cfg.UPLOAD_ENABLED = True
cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = self.root_path
cfg.UPLOAD_DELETE_ALLOWED = False
cfg.UPLOAD_PUT_ALLOWED = False
cfg.UPLOAD_DEFAULT_FILENAME = self.default_filename
importer = Importer(cfg)
importer.import_modules()
return Context(None, cfg, importer)
示例8: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
cfg = Config(SECURITY_KEY='ACME-SEC')
cfg.LOADER = "thumbor.loaders.file_loader"
cfg.FILE_LOADER_ROOT_PATH = storage_path
cfg.STORAGE = "thumbor.storages.file_storage"
cfg.FILE_STORAGE_ROOT_PATH = FILE_STORAGE_ROOT_PATH
if exists(FILE_STORAGE_ROOT_PATH):
rmtree(FILE_STORAGE_ROOT_PATH)
importer = Importer(cfg)
importer.import_modules()
server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', None)
server.security_key = 'ACME-SEC'
ctx = Context(server, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例9: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
self.default_filename = "image"
cfg = Config()
cfg.UPLOAD_ENABLED = True
cfg.UPLOAD_PHOTO_STORAGE = "thumbor.storages.file_storage"
cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
cfg.UPLOAD_DELETE_ALLOWED = True
cfg.UPLOAD_PUT_ALLOWED = False
cfg.UPLOAD_DEFAULT_FILENAME = self.default_filename
importer = Importer(cfg)
importer.import_modules()
ctx = Context(None, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例10: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
self.default_filename = 'image'
cfg = Config()
cfg.UPLOAD_ENABLED = True
cfg.UPLOAD_PUT_ALLOWED = True
cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
cfg.UPLOAD_DEFAULT_FILENAME = self.default_filename
cfg.MIN_WIDTH = 40
cfg.MIN_HEIGHT = 40
cfg.UPLOAD_MAX_SIZE = 72000
importer = Importer(cfg)
importer.import_modules()
ctx = Context(None, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例11: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
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
示例12: get_app
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_app(self):
file_storage_root_path = '/tmp/thumbor-vows/storage'
if exists(file_storage_root_path):
rmtree(file_storage_root_path)
cfg = Config()
cfg.USE_BLACKLIST = True
cfg.LOADER = "thumbor.loaders.file_loader"
cfg.FILE_LOADER_ROOT_PATH = abspath(join(dirname(__file__), 'fixtures/'))
cfg.STORAGE = 'thumbor.storages.file_storage'
cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
importer = Importer(cfg)
importer.import_modules()
server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'debug', None)
ctx = Context(server, cfg, importer)
application = ThumborServiceApp(ctx)
return application
示例13: get_context
# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
def get_context(self):
cfg = Config(SECURITY_KEY='ACME-SEC')
cfg.LOADER = "tests.stub_file_loader"
cfg.STORAGE = "thumbor.storages.file_storage"
cfg.FILE_STORAGE_ROOT_PATH = self.root_path
cfg.QUALITY = 'keep'
cfg.SVG_DPI = 200
self.image = 'http://test.domain/image.jpg'
self.quoted_image = quote(self.image, safe='')
self.transform = '400x400/smart'
self.signature = UrlSigner(security_key="ACME-SEC").signature('%s/%s' % (self.transform, self.quoted_image))
self.signed_prefix = "/%s/%s" % (self.signature, self.transform)
self.full_image = "/%s/%s/%s" % (self.signature, self.transform, self.quoted_image)
importer = Importer(cfg)
importer.import_modules()
server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', 'thumbor_flexible_validation.app.ThumborServiceProxy')
server.security_key = 'ACME-SEC'
return Context(server, cfg, importer)