Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Switch from heroku.json to app button
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmior committed Aug 13, 2014
1 parent e5078d2 commit 14b5074
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
23 changes: 8 additions & 15 deletions README.markdown
Expand Up @@ -36,40 +36,33 @@ You can then access the local development server at [`http://localhost:8000/`](h
Deployment
==

The project is already set up for easy deployment with Heroku.
To create a new instance, run `heroku bootstrap`.
This requires the [heroku.json](https://github.com/rainforestapp/heroku.json) plugin which can be installed via `heroku plugins:install git@github.com:rainforestapp/heroku.json.git`.
Note that you will be warned that your account will be charged for the addons installed.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

The project is already set up for easy deployment with Heroku by clicking the button above.
Note that you will be warned if your account will be charged for the addons installed.
While I make no guarantees, I have attempted to select only free addons which leave room to upgrade.
You are still responsible for verifying any fees associated with any addons which will be installed.

To maintain the security of your installation, Django's secret key must be set to a [random string](https://www.grc.com/passwords.htm).

heroku config:add DJANGO_SECRET_KEY="<random string here>"

For the first deploy, and each new deploy, simply run `git push heroku master`.
Initially, and when the schema changes, run `syncdb` and `migrate`.

heroku run python manage.py syncdb
heroku run python manage.py migrate

You can view your new deployment in your browser via `heroku open`.
Static file serving will be broken as this requires an S3 account.
Static file serving can be modified to use Amazon S3.
Create a bucket on S3 and add the configuration to your Heroku installation.

heroku config:add AWS_ACCESS_KEY_ID="<AWS access key>"
heroku config:add AWS_SECRET_ACCESS_KEY="<AWS secret>"
heroku config:add AWS_STORAGE_BUCKET_NAME="<bucket name>"


You can manually run `collectstatic via
If using S3, you will find `collectstatic` takes a long time to run on every deploy.
To disable running automatically, simply set `DISABLE_COLLECTSTATIC=1`.
You can then manually run `collectstatic` via

heroku run python manage.py collectstatic --noinput

Optionally, to have `collectstatic` run automatically on every deploy, use

heroku labs:enable user-env-compile


Dependency management
==
Expand Down
18 changes: 18 additions & 0 deletions app.json
@@ -0,0 +1,18 @@
{
"name": "heroku-django-skeleton",
"description": "A simple project to get started with Django on Heroku",
"repository": "https://github.com/michaelmior/heroku-django-skeleton",
"keywords": ["python", "django", "template", "skeleton"],
"env": {
"DJANGO_SECRET_KEY": {
"description": "A randomly generated secret to secure your Django installation",
"generator": "secret"
}
},
"addons": [
"newrelic:stark"
],
"scripts": {
"postdeploy": "sh -c 'python manage.py syncdb --noinput; python manage.py migrate --noinput'"
}
}
10 changes: 0 additions & 10 deletions heroku.json

This file was deleted.

0 comments on commit 14b5074

Please sign in to comment.