ekapratama93 / thumbor-mongodb

MongoDB storage for Thumbor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thumbor-mongodb

codecov

MongoDB storage adapter for Thumbor. This is a fork from original Thumbor Community version of tc_mongodb. Additional feature includes:

  1. Support for MONGO_URI
  2. Support for Result Storage
  3. Ensure MongoDB index to speedup query
  4. Singleton Connection Pool

Configuration

MONGO STORAGE OPTIONS

MONGO_STORAGE_SERVER_HOST = 'localhost' # MongoDB storage server host
MONGO_STORAGE_SERVER_PORT = 27017 # MongoDB storage server port
MONGO_STORAGE_SERVER_DB = 'thumbor' # MongoDB storage server database name
MONGO_STORAGE_SERVER_COLLECTION = 'images' # MongoDB storage image collection

MONGO RESULT STORAGE OPTIONS

MONGO_RESULT_STORAGE_SERVER_HOST = 'localhost' # MongoDB storage server host
MONGO_RESULT_STORAGE_SERVER_PORT = 27017 # MongoDB storage server port
MONGO_RESULT_STORAGE_SERVER_DB = 'thumbor' # MongoDB storage server database name
MONGO_RESULT_STORAGE_SERVER_COLLECTION = 'images' # MongoDB storage image collection

Or you can use Mongo DB URI to create connection for something like ReplicaSet

MONGO STORAGE

MONGO_STORAGE_URI = 'mongodb://localhost:27017'

MONGO RESULT STORAGE

MONGO_RESULT_STORAGE_URI = 'mongodb://localhost:27017'

If both configuration exist, URI config will be prioritized.

Installation

You can install using Pip by referring to this github repo.

pip install git+https://github.com/ekapratama93/thumbor-mongodb.git

And then you need to set STORAGE and/or RESULT_STORAGE in your thumbor configuration

STORAGE = 'thumbor_mongodb.storages.mongo_storage'

RESULT_STORAGE = 'thumbor_mongodb.result_storages.mongo_storage'

About

MongoDB storage for Thumbor

License:MIT License


Languages

Language:Python 97.5%Language:Makefile 2.5%