SPOT - DotCloud environment loader
Hence you end up with a fair amount of boilerplate code in your application which figures out wether it is running locally or on DotCloud and instantiates the services for you to use accordingly.
Not anymore ... if you don't want to ;)
Enters SPOT (named after the French earth observation satellite). SPOT knows wether your code is running locally or on DotCloud, exposes each service parameters under the name you gave it in your build file.
www: type: python cache: type: redis
Then when you instantiate a spot.Dotcloud() object it will expose the cache services:
>>> import spot >>> dotcloud = spot.Dotcloud() >>> isinstance(dotcloud.cache, spot.Redis) True
When running locally:
>>> dotcloud.cache.host u'localhost'
But on DotCloud:
>>> dotcloud.cache.host u'SOMETHING.dotcloud.com'
>>> type(dotcloud.cache.server) <class 'redis.client.StrictRedis'>