From 9661ecaf8feb7c9a615199f044f8d469df2c3340 Mon Sep 17 00:00:00 2001 From: Sander van Leeuwen Date: Wed, 25 Oct 2017 14:11:36 +0200 Subject: [PATCH 01/26] Remove boto related settings that aren't used Since upgrade to boto3 in commit 12db5176d6c4c we don't need AWS_HEADERS anymore --- .../config/settings/production.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index cc518644a..b332c776f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -100,17 +100,6 @@ AWS_STORAGE_BUCKET_NAME = env('DJANGO_AWS_STORAGE_BUCKET_NAME') AWS_AUTO_CREATE_BUCKET = True AWS_QUERYSTRING_AUTH = False -# AWS cache settings, don't change unless you know what you're doing: -AWS_EXPIRY = 60 * 60 * 24 * 7 - -# TODO See: https://github.com/jschneier/django-storages/issues/47 -# Revert the following and use str after the above-mentioned bug is fixed in -# either django-storage-redux or boto -control = 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY) -AWS_HEADERS = { - 'Cache-Control': bytes(control, encoding='latin-1') -} - # URL that handles the media served from MEDIA_ROOT, used for managing # stored files. {% if cookiecutter.use_whitenoise == 'y' -%} From 8bfe18b52ad1a48abe5ae0346b19a96a596aec64 Mon Sep 17 00:00:00 2001 From: Dayson Pais Date: Sat, 30 Dec 2017 12:16:19 +0530 Subject: [PATCH 02/26] Update django from 1.11.8 to 2.0 - Refactor django.core.urlresolvers module import to django.urls. Resolves: The django.core.urlresolvers module is removed in favor of its new location, django.urls. - Add an app namespace to urls in user app. Resolves: Support for setting a URL instance namespace without an application namespace is removed. --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- .../{{cookiecutter.project_slug}}/users/models.py | 2 +- .../{{cookiecutter.project_slug}}/users/tests/test_urls.py | 2 +- .../{{cookiecutter.project_slug}}/users/urls.py | 1 + .../{{cookiecutter.project_slug}}/users/views.py | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 369d8464f..3eb0ae550 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ wheel==0.30.0 # Conservative Django -django==1.11.8 # pyup: <2.0 +django==2.0 # pyup: <2.0 # Configuration django-environ==0.4.4 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index c06f15da4..915823658 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -1,5 +1,5 @@ from django.contrib.auth.models import AbstractUser -from django.core.urlresolvers import reverse +from django.urls import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py index 6e181cc8e..4935b0f3e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -1,4 +1,4 @@ -from django.core.urlresolvers import reverse, resolve +from django.urls import reverse, resolve from test_plus.test import TestCase diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 600ccfbdf..7c83fab98 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -2,6 +2,7 @@ from django.conf.urls import url from . import views +app_name = 'users' urlpatterns = [ url( regex=r'^$', diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 777f42b74..7fa94c231 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -1,4 +1,4 @@ -from django.core.urlresolvers import reverse +from django.urls import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin From 9ca98e02d48bbf81d5b67904702aef1c04ea7d48 Mon Sep 17 00:00:00 2001 From: Dayson Pais Date: Thu, 25 Jan 2018 10:36:06 +0100 Subject: [PATCH 03/26] Update base.txt --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 3eb0ae550..eff485865 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ wheel==0.30.0 # Conservative Django -django==2.0 # pyup: <2.0 +django==2.0 # Configuration django-environ==0.4.4 From d4420e3dd663fcaf2e0813008977aebfe7b6b0ae Mon Sep 17 00:00:00 2001 From: Dayson Pais Date: Mon, 5 Feb 2018 10:23:10 +0000 Subject: [PATCH 04/26] Update base.txt --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index eff485865..b7de59750 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ wheel==0.30.0 # Conservative Django -django==2.0 +django==2.0 # pyup: < 2.1 # Configuration django-environ==0.4.4 From d133026968aca97d39000295433642d8a30de91a Mon Sep 17 00:00:00 2001 From: Dayson Pais Date: Mon, 5 Feb 2018 23:29:36 +0000 Subject: [PATCH 05/26] Update 0001_initial.py Increase max length of User.last_name to 150 characters. --- .../users/migrations/0001_initial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py index b2cfca39f..7cc96f62c 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py @@ -22,7 +22,7 @@ class Migration(migrations.Migration): ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), - ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')), + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), From 8941e4a81d3c8428477cdf1a2350df711cb098f4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 9 Feb 2018 02:46:23 -0800 Subject: [PATCH 06/26] Update pytz from 2017.3 to 2018.3 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 3d29fe16a..56a44833d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -43,7 +43,7 @@ psycopg2==2.7.4 awesome-slugify==1.6.5 # Time zones support -pytz==2017.3 +pytz==2018.3 # Redis support django-redis==4.8.0 From e7a47c6f9b823081b24a16f4c0cd2fcaf393f255 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 11 Feb 2018 02:06:17 -0500 Subject: [PATCH 07/26] Update coverage from 4.5 to 4.5.1 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 63ec8a534..cfd0b99cf 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ # Local development dependencies go here -r base.txt -coverage==4.5 +coverage==4.5.1 django-coverage-plugin==1.5.0 Sphinx==1.6.7 From 7d291e886305a3510f431aed015d4b0df595d943 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 11 Feb 2018 02:06:18 -0500 Subject: [PATCH 08/26] Update coverage from 4.5 to 4.5.1 --- {{cookiecutter.project_slug}}/requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/test.txt b/{{cookiecutter.project_slug}}/requirements/test.txt index 8e8969c73..2a6ed87fa 100644 --- a/{{cookiecutter.project_slug}}/requirements/test.txt +++ b/{{cookiecutter.project_slug}}/requirements/test.txt @@ -7,7 +7,7 @@ psycopg2==2.7.4 {%- endif %} -coverage==4.5 +coverage==4.5.1 flake8==3.5.0 # pyup: != 2.6.0 django-test-plus==1.0.22 factory-boy==2.10.0 From c0bcf3d22ec3f086d5c1b902598ea5e6fadc6b36 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 12 Feb 2018 11:00:24 -0500 Subject: [PATCH 09/26] Update sphinx from 1.6.7 to 1.7.0 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 63ec8a534..113d01cf0 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ coverage==4.5 django-coverage-plugin==1.5.0 -Sphinx==1.6.7 +Sphinx==1.7.0 django-extensions==1.9.9 Werkzeug==0.14.1 django-test-plus==1.0.22 From 26e35a5c79ef7faf1cab468577c9d1cb34aa8eda Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 12 Feb 2018 21:26:27 -0500 Subject: [PATCH 10/26] Update boto3 from 1.5.25 to 1.5.27 --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 952ba4bd0..3bc011b6d 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,7 +16,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ -boto3==1.5.25 +boto3==1.5.27 django-storages==1.6.5 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.6.0 From d783367a8644cbdaa05af2d35470ef16666f4f03 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 13 Feb 2018 14:37:40 +0000 Subject: [PATCH 11/26] Prevent pyup to Update Celery automatically --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 56a44833d..a568ab566 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -50,7 +50,7 @@ django-redis==4.8.0 redis>=2.10.5 {% if cookiecutter.use_celery == "y" %} -celery==3.1.25 +celery==3.1.25 # pyup: <4.0 {% endif %} {% if cookiecutter.use_compressor == "y" %} From bef1bb856e8434984ef4201b9ba28ee0936ce5c0 Mon Sep 17 00:00:00 2001 From: Sander van Leeuwen Date: Tue, 13 Feb 2018 16:04:43 +0100 Subject: [PATCH 12/26] Add cache control via AWS_S3_OBJECT_PARAMETERS setting Previously covered by AWS_HEADERS --- .../config/settings/production.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index b332c776f..327398374 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -100,6 +100,17 @@ AWS_STORAGE_BUCKET_NAME = env('DJANGO_AWS_STORAGE_BUCKET_NAME') AWS_AUTO_CREATE_BUCKET = True AWS_QUERYSTRING_AUTH = False +# AWS cache settings, don't change unless you know what you're doing: +AWS_EXPIRY = 60 * 60 * 24 * 7 + +# TODO See: https://github.com/jschneier/django-storages/issues/47 +# Revert the following and use str after the above-mentioned bug is fixed in +# either django-storage-redux or boto +control = 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY) +AWS_S3_OBJECT_PARAMETERS = { + 'CacheControl': bytes(control, encoding='latin-1'), +} + # URL that handles the media served from MEDIA_ROOT, used for managing # stored files. {% if cookiecutter.use_whitenoise == 'y' -%} From e8ca2dd8ea6396b8a9714ad270d0d56c4e847d01 Mon Sep 17 00:00:00 2001 From: Hashim Muqtadir Date: Fri, 16 Feb 2018 20:15:50 +0500 Subject: [PATCH 13/26] Add atomic requests setting to production.py (#1513) Since config/production.py sets a new value for `DATABASES['default']`, the `DATABASES['default']['ATOMIC_REQUESTS'] = True` setting from base gets overridden. So it's probably a good idea to add it back. --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 33542fbf9..cb0b8021b 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -177,7 +177,7 @@ TEMPLATES[0]['OPTIONS']['loaders'] = [ # Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ DATABASES['default'] = env.db('DATABASE_URL') DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', default={{ _DEFAULT_CONN_MAX_AGE }}) - +DATABASES['default']['ATOMIC_REQUESTS'] = True # CACHING # ------------------------------------------------------------------------------ From 07d7482dbe5a247d317c4033d0e15b6747a91609 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 16 Feb 2018 16:16:09 +0100 Subject: [PATCH 14/26] Update boto3 from 1.5.27 to 1.5.30 (#1512) --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 3bc011b6d..5b5a7d844 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,7 +16,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ -boto3==1.5.27 +boto3==1.5.30 django-storages==1.6.5 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.6.0 From 68ae00e028b27d080ece89b64e75ded6e55446fe Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 16 Feb 2018 16:16:23 +0100 Subject: [PATCH 15/26] Update ipdb from 0.10.3 to 0.11 (#1511) --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index e5624830d..697a40288 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ factory-boy==2.10.0 django-debug-toolbar==1.9.1 # improved REPL -ipdb==0.10.3 +ipdb==0.11 pytest-django==3.1.2 pytest-sugar==0.9.1 From 97f0ca6fa782c8d886a9a62327e2601873e48b53 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 16 Feb 2018 22:42:20 +0100 Subject: [PATCH 16/26] Update django from 2.0 to 2.0.2 (#1514) --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 9d57acd63..5bbeb5ec1 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ wheel==0.30.0 # Conservative Django -django==2.0 # pyup: < 2.1 +django==2.0.2 # pyup: < 2.1 # Configuration django-environ==0.4.4 From cbd44dc4b94fe327bd2ad77eb1066b0eacbf9ec3 Mon Sep 17 00:00:00 2001 From: jose Gabriel Guzman Lopez Date: Sun, 18 Feb 2018 11:20:15 -0500 Subject: [PATCH 17/26] Update README.rst (#1518) --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6536ab7ec..b1dbe10d7 100644 --- a/README.rst +++ b/README.rst @@ -38,7 +38,7 @@ production-ready Django projects quickly. Features --------- -* For Django 1.11 +* For Django 2.0 * Works with Python 3.6 * Renders Django projects with 100% starting test coverage * Twitter Bootstrap_ v4.0.0 - beta 1 (`maintained Foundation fork`_ also available) From 1452fe6ecd707a0ec72775b8a0ab4bb93039e286 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 18 Feb 2018 17:20:27 +0100 Subject: [PATCH 18/26] Update boto3 from 1.5.30 to 1.5.31 (#1517) --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 5b5a7d844..09151486d 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,7 +16,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ -boto3==1.5.30 +boto3==1.5.31 django-storages==1.6.5 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.6.0 From 30dfbbd0aba298066a709bee78f14a448108b45d Mon Sep 17 00:00:00 2001 From: Wan Liuyang Date: Tue, 20 Feb 2018 16:04:16 +0800 Subject: [PATCH 19/26] Remove AWS S3 header bytes workaround --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index f6f857876..3926f3db1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -103,12 +103,8 @@ AWS_QUERYSTRING_AUTH = False # AWS cache settings, don't change unless you know what you're doing: AWS_EXPIRY = 60 * 60 * 24 * 7 -# TODO See: https://github.com/jschneier/django-storages/issues/47 -# Revert the following and use str after the above-mentioned bug is fixed in -# either django-storage-redux or boto -control = 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY) AWS_S3_OBJECT_PARAMETERS = { - 'CacheControl': bytes(control, encoding='latin-1'), + 'CacheControl': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY), } # URL that handles the media served from MEDIA_ROOT, used for managing From c7238238f8804a0eeeb5b5ed6e7177c85c20a109 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 16 Feb 2018 22:00:34 +0000 Subject: [PATCH 20/26] Update README, Changelog and setup.py after Django 2.0 upgrade --- CHANGELOG.md | 4 ++++ README.rst | 2 +- setup.py | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24f8d11cc..304732b9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2018-02-16] +### Changed +- Upgraded to Django 2.0 (@epicwhale) + ## [2018-01-15] ### Changed - Removed Elastic Beanstalk support (@pydanny) diff --git a/README.rst b/README.rst index b1dbe10d7..b856810f1 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ Features * For Django 2.0 * Works with Python 3.6 * Renders Django projects with 100% starting test coverage -* Twitter Bootstrap_ v4.0.0 - beta 1 (`maintained Foundation fork`_ also available) +* Twitter Bootstrap_ v4.0.0 (`maintained Foundation fork`_ also available) * 12-Factor_ based settings via django-environ_ * Secure by default. We believe in SSL. * Optimized development and production settings diff --git a/setup.py b/setup.py index 56306f92d..a7efb0a64 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ except ImportError: # Our version ALWAYS matches the version of Django we support # If Django has a new release, we branch, tag, then update this setting after the tag. -version = '1.11.9' +version = '2.0.2' if sys.argv[-1] == 'tag': os.system('git tag -a %s -m "version %s"' % (version, version)) @@ -34,7 +34,7 @@ setup( classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', - 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: BSD License', @@ -42,7 +42,6 @@ setup( 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development', ], keywords=( From 76334c086ec71a522e0aa4b5091fd0bd7b7d0cf4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 20 Feb 2018 18:26:40 -0500 Subject: [PATCH 21/26] Update boto3 from 1.5.31 to 1.5.33 --- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 09151486d..75450eb92 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,7 +16,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ -boto3==1.5.31 +boto3==1.5.33 django-storages==1.6.5 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.6.0 From 3cfafcf347f035fb330ca1b6f3639d3ba2b50643 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Wed, 21 Feb 2018 18:43:29 -0500 Subject: [PATCH 22/26] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index b856810f1..939ad4a9a 100644 --- a/README.rst +++ b/README.rst @@ -111,7 +111,7 @@ Two Scoops of Django 1.11 :name: Two Scoops of Django 1.11 Cover :align: center :alt: Two Scoops of Django - :target: http://twoscoopspress.org/products/two-scoops-of-django-1-11 + :target: http://twoscoopspress.com/products/two-scoops-of-django-1-11 Two Scoops of Django is the best dessert-themed Django reference in the universe From f4cadeec97ef9f00652c27b7f8caff53e31e1ce9 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Wed, 21 Feb 2018 18:54:03 -0500 Subject: [PATCH 23/26] Disallow backslashes in author name --- hooks/pre_gen_project.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index a65fedae8..c48ce0ad8 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -11,6 +11,9 @@ project_slug = '{{ cookiecutter.project_slug }}' if hasattr(project_slug, 'isidentifier'): assert project_slug.isidentifier(), "'{}' project slug is not a valid Python identifier.".format(project_slug) +assert "\\" not in "{{ cookiecutter.author_name }}", "Don't include backslashes in author name." + + using_docker = '{{ cookiecutter.use_docker }}'.lower() if using_docker == 'n': TERMINATOR = "\x1b[0m" From 0164c330b33d31aa9853a860eec6b412316f45e0 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 22 Feb 2018 15:01:05 +0000 Subject: [PATCH 24/26] Move to the python:alpine docker image (#1482) * Move to the python:alpine docker image - Switch the base images for local and production to alpine - Install extra dependencies for psycopg2, Pillow and cffi - Change shebang for shell scripts to use sh instead of bash * Move to the python:alpine docker image - Migrate group and user creation to Alpine syntax * Move to the python:alpine docker image - Remove `function` keyword, unsupported in shell * Upgrade various places to the latest Python 3.6 * Test support for translations * Add gettext library, required for translations support * Add locale folder for translations support with README documenting it * Update Changelog * Tweak command to test translations support --- tests/test_docker.sh | 3 +++ .../compose/local/django/Dockerfile | 13 ++++++++++++- .../compose/local/django/celery/beat/start.sh | 2 +- .../compose/local/django/celery/worker/start.sh | 2 +- .../compose/local/django/start.sh | 2 +- .../compose/production/django/Dockerfile | 15 ++++++++++++--- .../production/django/celery/beat/start.sh | 2 +- .../production/django/celery/worker/start.sh | 2 +- .../compose/production/django/entrypoint.sh | 4 ++-- .../compose/production/django/gunicorn.sh | 2 +- {{cookiecutter.project_slug}}/locale/README.rst | 6 ++++++ 11 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/locale/README.rst diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 137694d7a..d80a091e4 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -19,3 +19,6 @@ docker-compose -f local.yml run django python manage.py test # return non-zero status code if there are migrations that have not been created docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } + +# Test support for translations +docker-compose -f local.yml run --rm django python manage.py makemessages diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index b9ee34b76..383b15776 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,7 +1,18 @@ -FROM python:3.6 +FROM python:3.6-alpine ENV PYTHONUNBUFFERED 1 +RUN apk update \ + # psycopg2 dependencies + && apk add --virtual build-deps gcc python3-dev musl-dev \ + && apk add postgresql-dev \ + # Pillow dependencies + && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ + # CFFI dependencies + && apk add libffi-dev openssl-dev py-cffi \ + # Translations dependencies + && apk add gettext + # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements RUN pip install -r /requirements/local.txt diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh index c26318b44..0ca8bb507 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh index 8b50c8cfd..4335340de 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/local/django/start.sh b/{{cookiecutter.project_slug}}/compose/local/django/start.sh index cf4a41667..50227e19e 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/start.sh +++ b/{{cookiecutter.project_slug}}/compose/local/django/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 48923c80b..2ded8253e 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -1,9 +1,18 @@ -FROM python:3.6 +FROM python:3.6-alpine ENV PYTHONUNBUFFERED 1 -RUN groupadd -r django \ - && useradd -r -g django django +RUN apk update \ + # psycopg2 dependencies + && apk add --virtual build-deps gcc python3-dev musl-dev \ + && apk add postgresql-dev \ + # Pillow dependencies + && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ + # CFFI dependencies + && apk add libffi-dev openssl-dev py-cffi + +RUN addgroup -S django \ + && adduser -S -G django django # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh index 845db0a3d..def83076c 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh index 4529aad92..10f0d20c5 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh index 3b83c7bb6..a40a2b7e4 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail @@ -25,7 +25,7 @@ export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$ export CELERY_BROKER_URL=$REDIS_URL/0 {% endif %} -function postgres_ready(){ +postgres_ready() { python << END import sys import psycopg2 diff --git a/{{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh b/{{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh index 25da06496..8846cafb2 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh +++ b/{{cookiecutter.project_slug}}/compose/production/django/gunicorn.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/locale/README.rst b/{{cookiecutter.project_slug}}/locale/README.rst new file mode 100644 index 000000000..c2f1dcd6f --- /dev/null +++ b/{{cookiecutter.project_slug}}/locale/README.rst @@ -0,0 +1,6 @@ +Translations +============ + +Translations will be placed in this folder when running:: + + python manage.py makemessages From b3a4d0ca14de37217c50c827a214e8d397727fde Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 22 Feb 2018 16:03:06 +0100 Subject: [PATCH 25/26] Update django-extensions from 1.9.9 to 2.0.0 (#1526) --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 697a40288..6004987d2 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -5,7 +5,7 @@ coverage==4.5.1 django-coverage-plugin==1.5.0 Sphinx==1.7.0 -django-extensions==1.9.9 +django-extensions==2.0.0 Werkzeug==0.14.1 django-test-plus==1.0.22 factory-boy==2.10.0 From a252830c3155eba27839a1b27bdd72f2ba02f3b3 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Thu, 22 Feb 2018 16:03:25 +0100 Subject: [PATCH 26/26] Update pytest from 3.3.2 to 3.4.1 (#1523) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1790a0216..085d5a147 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ sh==1.12.14 binaryornot==0.4.4 # Testing -pytest==3.3.2 +pytest==3.4.1 pycodestyle==2.3.1 pyflakes==1.6.0 tox==2.9.1