Skip to content

Development environments

codersquid edited this page Sep 20, 2013 · 3 revisions

Heroku environments

Heroku setup

TODO: instructions for setting up a heroku app after you checkout the repo.

  • install heroku toolbelt
  • install heroku-config plugin: jump to "heroku-config" description
  • set up local heroku config: get env files from me and then read about heroku:config push

Configuration

The django settings.py file use environment variables for environment-specific settings. Since we are using heroku, follow the practice of creating heroku environment files and running the app locally using foreman.

I've provided an env/ directory that contains local, dev, and prod. Edit the local file according to your local environment.

When doing development, if you want to run against your local environment:

foreman start -e env/local

If you want to run against the dev environment:

foreman start -e env/local

And so on. These environment files will point the app to the appropriate database, AWS keys, mail backends, etc.

These are the admin settings our django settings.py file uses. You can find the most up-to-date information in the source code.

ADMINS=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=
DATABASE_URL=
DEBUG=
DEFAULT_FILE_STORAGE=
DEFAULT_FROM_EMAIL=
EMAIL_BACKEND=
ENVELOPE_EMAIL_RECIPIENTS=
MAILGUN_ACCESS_KEY=
MAILGUN_SERVER_NAME=
SECRET_KEY=
SITE_ID=1
STATICFILES_STORAGE=
PORT=

Deployment

I don't have good docs for this yet, so here is a start. My git remotes for heroku are set up like this:

[venv] [sheila@yagi:~/repos/tyler:feature(*)]$ git remote -v
dev     git@heroku.com:rose-tyler-alpha.git (fetch)
dev     git@heroku.com:rose-tyler-alpha.git (push)
origin  git@github.com:runmycode/tyler.git (fetch)
origin  git@github.com:runmycode/tyler.git (push)
prod    git@heroku.com:researchcompendia.git (fetch)
prod    git@heroku.com:researchcompendia.git (push)

When I have a change to deploy to the heroku prod environment, I run

git push prod master

If you made any config changes, be sure that you have pushed them as well.

Clone this wiki locally