diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b49897..4c027974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +##[2016-08-10] +## Added +- PostgreSQL versions are now selectable, instead of defaulting to 9.5; the minimum version is 9.2, which is supported by [Heroku](https://devcenter.heroku.com/articles/heroku-postgresql#version-support-and-legacy-infrastructure) and Django (@burhan) +- Fixed minor issue in the README.rst (@burhan) + ##[2016-08-03] ## Changed - Upgrade to Bootstrap 4 Alpha 3 and its dependencies, including jQuery (@audreyr) diff --git a/README.rst b/README.rst index 1c7147e5..e9a1f9d2 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,7 @@ Features * Instructions for deploying to PythonAnywhere_ * Works with Python 2.7.x or 3.5.x * Run tests with unittest or py.test +* Customizable PostgreSQL version Optional Integrations @@ -76,7 +77,7 @@ Constraints ----------- * Only maintained 3rd party libraries are used. -* Uses PostgreSQL everywhere (9.0+) +* Uses PostgreSQL everywhere (9.2+) * Environment variables for configuration (This won't work with Apache/mod_wsgi). @@ -125,6 +126,12 @@ Answer the prompts with your own desired options_. For example:: use_docker [y]: n use_heroku [n]: y use_compressor [n]: y + Select postgresql_version: + 1 - 9.2 + 2 - 9.3 + 3 - 9.4 + 4 - 9.5 + Choose from 1, 2, 3, 4 [1]: 1 Select js_task_runner: 1 - Gulp 2 - Grunt diff --git a/cookiecutter.json b/cookiecutter.json index b7eafa58..67140f1f 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -18,6 +18,7 @@ "use_docker": "y", "use_heroku": "n", "use_compressor": "n", + "postgresql_version": ["9.2", "9.3", "9.4", "9.5"], "js_task_runner": ["Gulp", "Grunt", "Webpack", "None"], "use_lets_encrypt": "n", "open_source_license": ["MIT", "BSD", "GPLv3", "Apache Software License 2.0", "Not open source"] diff --git a/{{cookiecutter.project_slug}}/app.json b/{{cookiecutter.project_slug}}/app.json index a2349458..96ab574f 100644 --- a/{{cookiecutter.project_slug}}/app.json +++ b/{{cookiecutter.project_slug}}/app.json @@ -27,7 +27,12 @@ "postdeploy": "python manage.py migrate" }, "addons": [ - "heroku-postgresql:hobby-dev", + { + "plan": "heroku-postgresql:hobby-dev", + "options": { + "version": "{{ cookiecutter.postgresql_version }}" + } + }, "heroku-redis:hobby-dev", "mailgun" ] diff --git a/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile b/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile index 33272364..9cdaaba3 100644 --- a/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/postgres/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:9.5 +FROM postgres:{{ cookiecutter.postgresql_version }} # add backup scripts ADD backup.sh /usr/local/bin/backup