From b2816c0e9415217bf72b8b484e94ff57de4ed28f Mon Sep 17 00:00:00 2001 From: stepmr Date: Sat, 18 Jul 2015 12:48:04 -0700 Subject: [PATCH 1/3] Updated heroku setup - Heroku's free postgres tier is now "hobby-dev" - pg:backups require a scheduled time - add missing Mailgun API key --- {{cookiecutter.repo_name}}/README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index f5e9dd8a..87448c5f 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -166,8 +166,8 @@ Run these commands to deploy the project to Heroku: heroku create --buildpack https://github.com/heroku/heroku-buildpack-python - heroku addons:create heroku-postgresql:dev - heroku pg:backups schedule DATABASE_URL + heroku addons:create heroku-postgresql:hobby-dev + heroku pg:backups schedule --at '02:00 America/Los_Angeles' DATABASE_URL heroku pg:promote DATABASE_URL heroku addons:create mailgun @@ -181,7 +181,8 @@ Run these commands to deploy the project to Heroku: heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE heroku config:set DJANGO_MAILGUN_SERVER_NAME=YOUR_MALGUN_SERVER - + heroku config:set DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY + git push heroku master heroku run python manage.py migrate heroku run python manage.py check --deploy From 696eca2fd28a8049216a151ff4d09363e6bccd0b Mon Sep 17 00:00:00 2001 From: stepmr Date: Sat, 18 Jul 2015 13:09:59 -0700 Subject: [PATCH 2/3] Use PYTHONHASHSEED=random - Django reccomends setting the PYTHONHASHSEED environment variable to random. See: https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/#python-options --- {{cookiecutter.repo_name}}/README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index 87448c5f..845b6b0c 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -183,6 +183,8 @@ Run these commands to deploy the project to Heroku: heroku config:set DJANGO_MAILGUN_SERVER_NAME=YOUR_MALGUN_SERVER heroku config:set DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY + heroku config:set PYTHONHASHSEED=random + git push heroku master heroku run python manage.py migrate heroku run python manage.py check --deploy From a9e210dbf5fd3651a1c4de068441f9f435ec7795 Mon Sep 17 00:00:00 2001 From: stepmr Date: Sat, 18 Jul 2015 13:13:49 -0700 Subject: [PATCH 3/3] Generate safe secret_key by default Use openssl to generate a secure, random secret_key --- {{cookiecutter.repo_name}}/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index 845b6b0c..ba78ff6a 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -173,7 +173,7 @@ Run these commands to deploy the project to Heroku: heroku addons:create mailgun heroku addons:create memcachier:dev - heroku config:set DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE + heroku config:set DJANGO_SECRET_KEY=`openssl rand -base64 32` heroku config:set DJANGO_SETTINGS_MODULE='config.settings.production' heroku config:set DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE