From 14b507408450c5bb9be03b36baa9c41286fc9c99 Mon Sep 17 00:00:00 2001 From: Michael Mior Date: Wed, 13 Aug 2014 12:33:47 -0400 Subject: [PATCH] Switch from heroku.json to app button --- README.markdown | 23 ++++++++--------------- app.json | 18 ++++++++++++++++++ heroku.json | 10 ---------- 3 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 app.json delete mode 100644 heroku.json diff --git a/README.markdown b/README.markdown index 92e059a..b7e9bac 100644 --- a/README.markdown +++ b/README.markdown @@ -36,17 +36,13 @@ 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="" - For the first deploy, and each new deploy, simply run `git push heroku master`. Initially, and when the schema changes, run `syncdb` and `migrate`. @@ -54,22 +50,19 @@ Initially, and when the schema changes, run `syncdb` and `migrate`. 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="" heroku config:add AWS_SECRET_ACCESS_KEY="" heroku config:add AWS_STORAGE_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 == diff --git a/app.json b/app.json new file mode 100644 index 0000000..8278564 --- /dev/null +++ b/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'" + } +} diff --git a/heroku.json b/heroku.json deleted file mode 100644 index 3b05c81..0000000 --- a/heroku.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "addons": [ - "heroku-postgresql:dev", - "pgbackups:auto-month", - "rediscloud:20", - "newrelic:standard", - "sentry:developer" - ], - "env": {} -}