Skip to main content

DotCloud environment loader

Project description

SPOT - DotCloud environment loader


When working with DotCloud_ you will more than likely have a developement
environment locally that offers the services your application requires which
are specified in the `build file`_.

Locally one very rarely bother changing the parameters of the services from
their defaults settings but on DotCloud_ your application must read the
`environment file`_.

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`_.

For example if your build file contains a python_ service named www and a redis_
service named cache::

type: python
type: redis

Then when you instantiate a spot.Dotcloud() object it will expose the cache

>>> import spot
>>> dotcloud = spot.Dotcloud()
>>> isinstance(dotcloud.cache, spot.Redis)

When running locally::


But on DotCloud::


If you have installed the packages allowing Python to handle the services e.g.
redis_ (and hiredis_), the spot.Dotcloud instance also expose a connection to
the server you can use out of the box::

>>> type(dotcloud.cache.server)
<class 'redis.client.StrictRedis'>


At this stage only the Redis_ and MongoDB_ services are managed. I will add more
as I *require* them ... or you can contribute and submit new services definition
via pull request ;)

.. _DotCloud:
.. _redis:
.. _python:
.. _build file:
.. _environment file:
.. _redis:
.. _hiredis:
.. _mongodb:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spot-0.1a.tar.gz (3.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page