wri/gfw-api — pull request #30 by eightysteele (2013-12-06 05:12:27+00:00)
Title: WIP for adding dev support

@matallo Yo dude, here's a start... Open to ideas and suggestions here for sure! Tell me what you think! :D

Basically this PR adds automatic runtime configuration support for dev (running on localhost) and prod (running on app engine). It automatically switches to `stories_dev` table in dev and to `community_stories` table in prod. Are there other tables we want to add support for?

All you need to do is add a couple of runtime configuration files (`dev.json` and `prod.json`) in the root directory of the project. They specify the CartoDB endpoint to use, the CartoDB API Key, the WRI emails, and whatever other configs are needed when running in dev or prod. The files look like this:

```json
{
"cdb_endpoint":"http://wri-01.cartodb.com/api/v1/sql",
"cdb_api_key":"CARTODB_API_KEY",
"wri_emails_stories":[
"gfw@wri.org",
"janderson@wri.org",
"sminnemeyer@wri.org",
"asteele@wri.org",
"aleach@wri.org"
]
}
```

That's it dude! Not sure this solves all the immediate issues but let me know.

FYI the runtime config is populated from those config files and is available for import from any module:

```python
from appengine_config import runtime_config
```