From 17e7d603cf8ccea58dfc8e29873abae5b2f4c26a Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:08:51 +0200 Subject: [PATCH 01/90] Added the MAILGUN_API_URL variable to the ANYMAIL configuration so we can easily switch to the EU region for mailgun --- {{cookiecutter.project_slug}}/config/settings/production.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 3db964b66..3b61b470e 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -161,6 +161,7 @@ EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend" ANYMAIL = { "MAILGUN_API_KEY": env("MAILGUN_API_KEY"), "MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"), + "MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"), } # Gunicorn From 4efba872cc4ee316cc955e7e742868c40a9e97c3 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:11:56 +0200 Subject: [PATCH 02/90] Added myself to CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 154fa1ac5..9486b3a00 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -114,6 +114,7 @@ Listed in alphabetical order. Irfan Ahmad `@erfaan`_ @erfaan Jan Van Bruggen `@jvanbrug`_ Jens Nilsson `@phiberjenz`_ + Jelmer Draaijer `@foarsitter`_ Jerome Leclanche `@jleclanche`_ @Adys Jimmy Gitonga `@afrowave`_ @afrowave John Cass `@jcass77`_ @cass_john @@ -231,6 +232,7 @@ Listed in alphabetical order. .. _@eriol: https://github.com/eriol .. _@eyadsibai: https://github.com/eyadsibai .. _@flyudvik: https://github.com/flyudvik +.. _@foarsitter: https://github.com/foarsitter .. _@garry-cairns: https://github.com/garry-cairns .. _@garrypolley: https://github.com/garrypolley .. _@goldhand: https://github.com/goldhand From f6f2942a91612b0691fe650d843810662acf229d Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:17:22 +0200 Subject: [PATCH 03/90] Listed MAILGUN_API_URL in settings docs --- docs/settings.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.rst b/docs/settings.rst index 705add877..6e4b363c3 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -48,6 +48,7 @@ SENTRY_DSN SENTRY_DSN n/a DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error +MAILGUN_API_URL n/a n/a "https://api.mailgun.net/v3" ======================================= =========================== ============================================== ====================================================================== -------------------------- From 895298c28f77857743415ca8675a8c38f36bf153 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 15:26:55 +0100 Subject: [PATCH 04/90] Refactor Celery integration according to current best practices - Change celery app to not be a Django app, more like a WSGI app - Define a Celery task in the Django users app - Write a test to execute the task - Update scripts to use the new app to start workers - Update documentation Fix #865 --- hooks/post_gen_project.py | 14 +++++-- {{cookiecutter.project_slug}}/Procfile | 2 +- {{cookiecutter.project_slug}}/README.rst | 2 +- .../compose/local/django/celery/beat/start | 2 +- .../compose/local/django/celery/flower/start | 2 +- .../compose/local/django/celery/worker/start | 2 +- .../production/django/celery/beat/start | 2 +- .../production/django/celery/flower/start | 2 +- .../production/django/celery/worker/start | 2 +- .../config/__init__.py | 7 ++++ .../config/celery_app.py | 16 ++++++++ .../config/settings/base.py | 1 - .../taskapp/__init__.py | 0 .../taskapp/celery.py | 38 ------------------- .../users/tasks.py | 11 ++++++ .../users/tests/test_tasks.py | 16 ++++++++ 16 files changed, 69 insertions(+), 50 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/config/celery_app.py delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/__init__.py delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ab05b375a..292f6e7f6 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -89,8 +89,16 @@ def remove_packagejson_file(): os.remove(file_name) -def remove_celery_app(): - shutil.rmtree(os.path.join("{{ cookiecutter.project_slug }}", "taskapp")) +def remove_celery_files(): + file_names = [ + os.path.join("config", "celery_app.py"), + os.path.join("{{ cookiecutter.project_slug }}", "users", "tasks.py"), + os.path.join( + "{{ cookiecutter.project_slug }}", "users", "tests", "test_tasks.py" + ), + ] + for file_name in file_names: + os.remove(file_name) def remove_dottravisyml_file(): @@ -321,7 +329,7 @@ def main(): remove_node_dockerfile() if "{{ cookiecutter.use_celery }}".lower() == "n": - remove_celery_app() + remove_celery_files() if "{{ cookiecutter.use_docker }}".lower() == "y": remove_celery_compose_dirs() diff --git a/{{cookiecutter.project_slug}}/Procfile b/{{cookiecutter.project_slug}}/Procfile index d9319f5cc..5b8e9eaf8 100644 --- a/{{cookiecutter.project_slug}}/Procfile +++ b/{{cookiecutter.project_slug}}/Procfile @@ -1,5 +1,5 @@ release: python manage.py migrate web: gunicorn config.wsgi:application {% if cookiecutter.use_celery == "y" -%} -worker: celery worker --app={{cookiecutter.project_slug}}.taskapp --loglevel=info +worker: celery worker --app=config.celery_app --loglevel=info {%- endif %} diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 6ef3b63c4..b8fdd0ddf 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -79,7 +79,7 @@ To run a celery worker: .. code-block:: bash cd {{cookiecutter.project_slug}} - celery -A {{cookiecutter.project_slug}}.taskapp worker -l info + celery -A config.celery_app worker -l info Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right. diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start index 4e2493f3b..389e2baf1 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start @@ -5,4 +5,4 @@ set -o nounset rm -f './celerybeat.pid' -celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO +celery -A config.celery_app beat -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start index f0abae7ef..be67050da 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start @@ -5,6 +5,6 @@ set -o nounset celery flower \ - --app={{cookiecutter.project_slug}}.taskapp \ + --app=config.celery_app \ --broker="${CELERY_BROKER_URL}" \ --basic_auth="${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}" diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start index c8bc31d3a..072c6ae62 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start @@ -4,4 +4,4 @@ set -o errexit set -o nounset -celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO +celery -A config.celery_app worker -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start index def83076c..0e793e38e 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start @@ -5,4 +5,4 @@ set -o pipefail set -o nounset -celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO +celery -A config.celery_app beat -l INFO diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start index f0abae7ef..be67050da 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start @@ -5,6 +5,6 @@ set -o nounset celery flower \ - --app={{cookiecutter.project_slug}}.taskapp \ + --app=config.celery_app \ --broker="${CELERY_BROKER_URL}" \ --basic_auth="${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}" diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start index 10f0d20c5..4e519c3fc 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start @@ -5,4 +5,4 @@ set -o pipefail set -o nounset -celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO +celery -A config.celery_app worker -l INFO diff --git a/{{cookiecutter.project_slug}}/config/__init__.py b/{{cookiecutter.project_slug}}/config/__init__.py index e69de29bb..480655af1 100644 --- a/{{cookiecutter.project_slug}}/config/__init__.py +++ b/{{cookiecutter.project_slug}}/config/__init__.py @@ -0,0 +1,7 @@ +{% if cookiecutter.use_celery == 'y' -%} +# This will make sure the app is always imported when +# Django starts so that shared_task will use this app. +from .celery_app import app as celery_app + +__all__ = ("celery_app",) +{% endif -%} diff --git a/{{cookiecutter.project_slug}}/config/celery_app.py b/{{cookiecutter.project_slug}}/config/celery_app.py new file mode 100644 index 000000000..e275f054f --- /dev/null +++ b/{{cookiecutter.project_slug}}/config/celery_app.py @@ -0,0 +1,16 @@ +import os +from celery import Celery + +# set the default Django settings module for the 'celery' program. +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") + +app = Celery("{{cookiecutter.project_slug}}") + +# Using a string here means the worker doesn't have to serialize +# the configuration object to child processes. +# - namespace='CELERY' means all celery-related configuration keys +# should have a `CELERY_` prefix. +app.config_from_object("django.conf:settings", namespace="CELERY") + +# Load task modules from all registered Django app configs. +app.autodiscover_tasks() diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index f8d223771..b4d064fe5 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -225,7 +225,6 @@ MANAGERS = ADMINS {% if cookiecutter.use_celery == 'y' -%} # Celery # ------------------------------------------------------------------------------ -INSTALLED_APPS += ["{{cookiecutter.project_slug}}.taskapp.celery.CeleryAppConfig"] if USE_TZ: # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-timezone CELERY_TIMEZONE = TIME_ZONE diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py deleted file mode 100644 index 529da1ae0..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py +++ /dev/null @@ -1,38 +0,0 @@ -{% if cookiecutter.use_celery == 'y' -%} -import os -from celery import Celery -from django.apps import apps, AppConfig -from django.conf import settings - - -if not settings.configured: - # set the default Django settings module for the 'celery' program. - os.environ.setdefault( - "DJANGO_SETTINGS_MODULE", "config.settings.local" - ) # pragma: no cover - - -app = Celery("{{cookiecutter.project_slug}}") -# Using a string here means the worker will not have to -# pickle the object when using Windows. -# - namespace='CELERY' means all celery-related configuration keys -# should have a `CELERY_` prefix. -app.config_from_object("django.conf:settings", namespace="CELERY") - - -class CeleryAppConfig(AppConfig): - name = "{{cookiecutter.project_slug}}.taskapp" - verbose_name = "Celery Config" - - def ready(self): - installed_apps = [app_config.name for app_config in apps.get_app_configs()] - app.autodiscover_tasks(lambda: installed_apps, force=True) - - -@app.task(bind=True) -def debug_task(self): - print(f"Request: {self.request!r}") # pragma: no cover -{% else %} -# Use this as a starting point for your project with celery. -# If you are not using celery, you can remove this app -{% endif -%} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py new file mode 100644 index 000000000..c99341c5f --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py @@ -0,0 +1,11 @@ +from django.contrib.auth import get_user_model + +from config import celery_app + +User = get_user_model() + + +@celery_app.task() +def get_users_count(): + """A pointless Celery task to demonstrate usage.""" + return User.objects.count() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py new file mode 100644 index 000000000..addb091db --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_tasks.py @@ -0,0 +1,16 @@ +import pytest +from celery.result import EagerResult + + +from {{ cookiecutter.project_slug }}.users.tasks import get_users_count +from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory + + +@pytest.mark.django_db +def test_user_count(settings): + """A basic test to execute the get_users_count Celery task.""" + UserFactory.create_batch(3) + settings.CELERY_TASK_ALWAYS_EAGER = True + task_result = get_users_count.delay() + assert isinstance(task_result, EagerResult) + assert task_result.result == 3 From f6e84cb2115cce1e2017c3011c0303adc915eaab Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 19:11:47 +0100 Subject: [PATCH 05/90] Upgrade Django to 2.1.8 --- {{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 9d4aec7dc..6c70c367f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -18,7 +18,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.0.13 # pyup: < 2.1 # https://www.djangoproject.com/ +django==2.1.8 # pyup: < 2.2 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.1.2 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth From 57dd157c4ae604c58bd754fb9d769f8081eedbbf Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 19:37:12 +0100 Subject: [PATCH 06/90] Remove deprecated password hasher --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index f8d223771..026c88cf5 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -109,7 +109,6 @@ PASSWORD_HASHERS = [ "django.contrib.auth.hashers.PBKDF2PasswordHasher", "django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher", "django.contrib.auth.hashers.BCryptSHA256PasswordHasher", - "django.contrib.auth.hashers.BCryptPasswordHasher", ] # https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ From dd284bc8c998cf43c9ea8b4c52b10280c43628c6 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 19:37:59 +0100 Subject: [PATCH 07/90] Remove Postgres 9.3 as it's not supported by Django 2.1 --- cookiecutter.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index b5dda0c70..11e4456f7 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -25,8 +25,7 @@ "10.1", "9.6", "9.5", - "9.4", - "9.3" + "9.4" ], "js_task_runner": [ "None", From 2dcbaca3ee292d3dbcc0271f9add1bd7b3361037 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 19:38:23 +0100 Subject: [PATCH 08/90] Update documentation --- README.rst | 25 ++++++++++++------------ docs/project-generation-options.rst | 15 +++++++------- {{cookiecutter.project_slug}}/README.rst | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index 2c037e51f..002150928 100644 --- a/README.rst +++ b/README.rst @@ -36,10 +36,10 @@ production-ready Django projects quickly. Features --------- -* For Django 2.0 +* For Django 2.1 * Works with Python 3.6 * Renders Django projects with 100% starting test coverage -* Twitter Bootstrap_ v4.1.1 (`maintained Foundation fork`_ also available) +* Twitter Bootstrap_ v4 (`maintained Foundation fork`_ also available) * 12-Factor_ based settings via django-environ_ * Secure by default. We believe in SSL. * Optimized development and production settings @@ -89,8 +89,8 @@ Constraints ----------- * Only maintained 3rd party libraries are used. -* Uses PostgreSQL everywhere (9.2+) -* Environment variables for configuration (This won't work with Apache/mod_wsgi except on AWS ELB). +* Uses PostgreSQL everywhere (9.4 - 10.5) +* Environment variables for configuration (This won't work with Apache/mod_wsgi). Support this Project! ---------------------- @@ -169,14 +169,15 @@ Answer the prompts with your own desired options_. For example:: use_heroku [n]: y use_compressor [n]: y Select postgresql_version: - 1 - 10.3 - 2 - 10.2 - 3 - 10.1 - 4 - 9.6 - 5 - 9.5 - 6 - 9.4 - 7 - 9.3 - Choose from 1, 2, 3, 4 [1]: 1 + 1 - 10.5 + 2 - 10.4 + 3 - 10.3 + 4 - 10.2 + 5 - 10.1 + 6 - 9.6 + 7 - 9.5 + 8 - 9.4 + Choose from 1, 2, 3, 4, 5, 6, 7, 8 [1]: 1 Select js_task_runner: 1 - None 2 - Gulp diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index a54837979..f9824a6d2 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -49,13 +49,14 @@ use_docker: postgresql_version: Select a PostgreSQL_ version to use. The choices are: - 1. 10.3 - 2. 10.2 - 3. 10.1 - 4. 9.6 - 5. 9.5 - 6. 9.4 - 7. 9.3 + 1. 10.5 + 2. 10.4 + 3. 10.3 + 4. 10.2 + 5. 10.1 + 6. 9.6 + 7. 9.5 + 8. 9.4 js_task_runner: Select a JavaScript task runner. The choices are: diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 6ef3b63c4..b9dbf218a 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -159,7 +159,7 @@ Custom Bootstrap Compilation ^^^^^^ The generated CSS is set up with automatic Bootstrap recompilation with variables of your choice. -Bootstrap v4.1.1 is installed using npm and customised by tweaking your variables in ``static/sass/custom_bootstrap_vars``. +Bootstrap v4 is installed using npm and customised by tweaking your variables in ``static/sass/custom_bootstrap_vars``. You can find a list of available variables `in the bootstrap source`_, or get explanations on them in the `Bootstrap docs`_. From 352be0eec947cff860ddd289cbe05ba709bbf03b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 17 Apr 2019 12:00:31 +0100 Subject: [PATCH 09/90] Update mypy from 0.700 to 0.701 --- {{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 60c68dd1c..a2f72eda9 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.700 # https://github.com/python/mypy +mypy==0.701 # https://github.com/python/mypy pytest==4.4.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From 5a3d9050a4d6274f206bb2c2979d89188feaebcf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 17 Apr 2019 12:00:36 +0100 Subject: [PATCH 10/90] Update pylint-django from 2.0.6 to 2.0.7 --- {{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 60c68dd1c..d0e909e53 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -20,7 +20,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar flake8==3.7.5 # https://github.com/PyCQA/flake8 coverage==4.5.3 # https://github.com/nedbat/coveragepy black==19.3b0 # https://github.com/ambv/black -pylint-django==2.0.6 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.7 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From a1692ef5410b98583def7703d156305800d9e95c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 17 Apr 2019 19:13:06 -0700 Subject: [PATCH 11/90] Update tox from 3.8.6 to 3.9.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cfd0c8476..ea10eaa53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.8.6 +tox==3.9.0 pytest==4.4.1 pytest_cases==1.6.2 pytest-cookies==0.3.0 From 113f1ed53095a7439d40e10d625019eab248e122 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 18 Apr 2019 12:00:29 +0100 Subject: [PATCH 12/90] Update pylint-django from 2.0.7 to 2.0.8 --- {{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 bd2d58ad3..5d85b6ff2 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -20,7 +20,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar flake8==3.7.5 # https://github.com/PyCQA/flake8 coverage==4.5.3 # https://github.com/nedbat/coveragepy black==19.3b0 # https://github.com/ambv/black -pylint-django==2.0.7 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.8 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From 7358fef56af367dac58bd9691128ddc416542b93 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 24 Apr 2019 12:00:28 +0100 Subject: [PATCH 13/90] Update sentry-sdk from 0.7.10 to 0.7.11 --- {{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 d9fa2550d..c430e436c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.7.10 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.11 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 2f77d48496c98a52eadec4fec82c52f13b035243 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 26 Apr 2019 12:00:28 +0100 Subject: [PATCH 14/90] Update sentry-sdk from 0.7.11 to 0.7.12 --- {{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 c430e436c..21e4cc8dc 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.7.11 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.12 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 09735eadfd3e36a67800a0e80bbd0d206032972a Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 26 Apr 2019 12:00:32 +0100 Subject: [PATCH 15/90] Update pylint-django from 2.0.8 to 2.0.9 --- {{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 5d85b6ff2..85f60a4ac 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -20,7 +20,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar flake8==3.7.5 # https://github.com/PyCQA/flake8 coverage==4.5.3 # https://github.com/nedbat/coveragepy black==19.3b0 # https://github.com/ambv/black -pylint-django==2.0.8 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.9 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From bf6f17b1b9924672022d0c99475e5dbb834e7d1f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 30 Apr 2019 12:00:31 +0100 Subject: [PATCH 16/90] Update sentry-sdk from 0.7.12 to 0.7.14 --- {{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 21e4cc8dc..4ae99be3f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.7.12 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.14 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 07a685326c973e8559c5e0d88ae6863079e618c3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 30 Apr 2019 12:00:34 +0100 Subject: [PATCH 17/90] Update djangorestframework from 3.9.2 to 3.9.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 39bec2d45..a6031c884 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,5 +29,5 @@ django-compressor==2.2 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.9.2 # https://github.com/encode/django-rest-framework +djangorestframework==3.9.3 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From 964662742a63035da4a31839b991cf62a0a5f1d3 Mon Sep 17 00:00:00 2001 From: Craig Margieson Date: Mon, 6 May 2019 15:10:18 +0930 Subject: [PATCH 18/90] Add to contributors. --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index ded1606b2..41bf6f653 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -84,6 +84,7 @@ Listed in alphabetical order. Christopher Clarke `@chrisdev`_ Cole Mackenzie `@cmackenzie1`_ Collederas `@Collederas`_ + Craig Margieson `@cmargieson`_ Cristian Vargas `@cdvv7788`_ Cullen Rhodes `@c-rhodes`_ Dan Shultz `@shultz`_ From 5ab5285e5f741e1c7d87bf0a176ebb8de131aba6 Mon Sep 17 00:00:00 2001 From: Craig Margieson Date: Mon, 6 May 2019 15:13:01 +0930 Subject: [PATCH 19/90] Edit STATIC and MEDIA urls for GCE production. --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 4adbdb9c4..63225bee9 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -104,7 +104,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {%- elif cookiecutter.cloud_provider == 'GCE' %} -STATIC_URL = "https://storage.googleapis.com/{}/static".format(GS_BUCKET_NAME) +STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} # MEDIA @@ -128,8 +128,8 @@ class MediaRootS3Boto3Storage(S3Boto3Storage): DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootS3Boto3Storage" MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/" {%- elif cookiecutter.cloud_provider == 'GCE' %} -MEDIA_URL = "https://storage.googleapis.com/{}/media".format(GS_BUCKET_NAME) -MEDIA_ROOT = "https://storage.googleapis.com/{}/media".format(GS_BUCKET_NAME) +MEDIA_URL = "https://storage.googleapis.com/{}/media/".format(GS_BUCKET_NAME) +MEDIA_ROOT = "https://storage.googleapis.com/{}/media/".format(GS_BUCKET_NAME) {%- endif %} # TEMPLATES From 1646daa277372fb0dc5a215e7f12edfb362d248c Mon Sep 17 00:00:00 2001 From: Craig Margieson Date: Mon, 6 May 2019 15:30:02 +0930 Subject: [PATCH 20/90] Added link in contributors. --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 41bf6f653..6fa9e1c0d 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -318,6 +318,7 @@ Listed in alphabetical order. .. _@ericgroom: https://github.com/ericgroom .. _@hanaquadara: https://github.com/hanaquadara .. _@vladdoster: https://github.com/vladdoster +.. _@cmargieson: https://github.com/cmargieson Special Thanks ~~~~~~~~~~~~~~ From 07f2a25219db1d1a69017a1e5cae3193e1771904 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 7 May 2019 06:52:01 +0100 Subject: [PATCH 21/90] Update psycopg2-binary from 2.8 to 2.8.2 (#2034) --- {{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 85f60a4ac..7095af3df 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -6,7 +6,7 @@ Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} -psycopg2-binary==2.8 # https://github.com/psycopg/psycopg2 +psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 {%- endif %} # Testing From 642521dc5e80de72bc3a8d7e2bd7127e933ced2e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 9 May 2019 12:00:32 +0100 Subject: [PATCH 22/90] Update pytest from 4.4.1 to 4.4.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ea10eaa53..3644de168 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ tox==3.9.0 -pytest==4.4.1 +pytest==4.4.2 pytest_cases==1.6.2 pytest-cookies==0.3.0 pyyaml==5.1 From 42fc45d38afb9f81e4f5ae40b9f5782f2ce5f2c8 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 9 May 2019 12:00:33 +0100 Subject: [PATCH 23/90] Update pytest from 4.4.1 to 4.4.2 --- {{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 7095af3df..3ef434e98 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.701 # https://github.com/python/mypy -pytest==4.4.1 # https://github.com/pytest-dev/pytest +pytest==4.4.2 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 8933aa17c08462d4ef0994f963b6ba2a04071b17 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Fri, 10 May 2019 11:42:07 -0400 Subject: [PATCH 24/90] The signal should be imported from project_slug I am getting an error if I create a signal.py file under users model. Here is the stacktrace Tracking file by folder pattern: migrations Unhandled exception in thread started by .wrapper at 0x000002663A074048> Traceback (most recent call last): File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception raise _exception[1] File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\core\management\__init__.py", line 337, in execute autoreload.check_errors(django.setup)() File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\apps\registry.py", line 120, in populate app_config.ready() File "C:\Users\srao\projects\kbs\kbs\users\apps.py", line 11, in ready import users.signals # noqa F401 File "C:\Users\srao\projects\kbs\kbs\users\signals.py", line 3, in from .models import User File "C:\Users\srao\projects\kbs\kbs\users\models.py", line 8, in class User(AbstractUser): File "C:\Apps\Anaconda3\envs\registration\lib\site-packages\django\db\models\base.py", line 95, in __new__ "INSTALLED_APPS." % (module, name) RuntimeError: Model class users.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. Having the signal be imported from project_slug.users.signal fixes the issue. --- .../{{cookiecutter.project_slug}}/users/apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py index 854665fd3..ded2072ff 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py @@ -8,6 +8,6 @@ class UsersAppConfig(AppConfig): def ready(self): try: - import users.signals # noqa F401 + import {{ cookiecutter.project_slug }}.users.signals # noqa F401 except ImportError: pass From 4bca52c835050485a4036d2a451bcc27bddef3ee Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 11 May 2019 12:00:28 +0100 Subject: [PATCH 25/90] Update djangorestframework from 3.9.3 to 3.9.4 --- {{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 dc54eb33b..29e7f2b94 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -29,5 +29,5 @@ django-compressor==2.2 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.9.3 # https://github.com/encode/django-rest-framework +djangorestframework==3.9.4 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From bad8e972c58872cf6593593544d99ce191a125ed Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 12 May 2019 12:00:29 +0100 Subject: [PATCH 26/90] Update pytest from 4.4.2 to 4.5.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3644de168..9391b0c6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ tox==3.9.0 -pytest==4.4.2 +pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 pyyaml==5.1 From 4373e205a8cf53f6e4e3916c16a4c6278b2e8059 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 12 May 2019 12:00:30 +0100 Subject: [PATCH 27/90] Update pytest from 4.4.2 to 4.5.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 3ef434e98..1f8ab08dc 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.701 # https://github.com/python/mypy -pytest==4.4.2 # https://github.com/pytest-dev/pytest +pytest==4.5.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 4e20733b6a2f52db012a57fcdd59c5cd0e972a5f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 12 May 2019 12:00:33 +0100 Subject: [PATCH 28/90] Update factory-boy from 2.11.1 to 2.12.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 3ef434e98..8f26f0e62 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -27,7 +27,7 @@ pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery # Django # ------------------------------------------------------------------------------ -factory-boy==2.11.1 # https://github.com/FactoryBoy/factory_boy +factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==1.11 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.1.6 # https://github.com/django-extensions/django-extensions From 64727f5096a36d6b99587d0218be90a95839d035 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 12 May 2019 20:26:46 +0100 Subject: [PATCH 29/90] Update changelog with main changes from the past 15 months --- CHANGELOG.md | 165 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 304732b9f..0e59b3b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,171 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2019-05-08] +### Changed +- Upgraded to Django 2.1 (@browniebroke) + +## [2019-04-07] +### Added +- Support for Google Cloud Storage (@ahhda) + +## [2019-04-03] +### Added +- Command to backup Db to AWS S3 (@foarsitter) + +## [2019-03-25] +### Added +- Node image to run Gulp with Docker (@browniebroke) + +## [2019-03-19] +### Changed +- Replaced Caddy with Traefik (@demestav) + +## [2019-03-11] +### Changed +- Sentry integration from Raven to Sentry-SDK (@gfabricio) +- Made Redis config conditional on Celery locally (@demestav) + +## [2019-03-11] +### Added +- Automatic migrations on Heroku (@yunti) + +## [2019-03-06] +### Fixed +- Missing script tag in Travis config (@btknu) + +## [2019-03-02] +### Changed +- Celery eager setting in local setting with Docker (@keithjeb) + +## [2019-03-01] +### Updated +- All NPM dependencies (@takkaria) + +## [2018-11-13] +### Changed +- Security settings in Dev (@carlmjohnson) + +## [2018-11-20] +### Fixed +- Passing the CSRF header from the reverse proxy to Django server for DRF (@hpbruna) + +## [2018-11-12] +### Fixed +- Initialisation of Celery app (@glasslion) + +## [2018-10-24] +### Fixed +- Persisting of iPython history between sessions (@davitovmasyan) + +### Added +- Postgres 10.5 option (@jleclanche) + +## [2018-09-18] +### Added +- Included `mypy` in dependencies and run it in tests (@apirobot) + +## [2018-09-18] +### Fixed +- Avoid `$` in environment variables to workaround a bug from django-environ (@browniebroke) + +## [2018-09-16] +### Fixed +- Bug in ordering of Middleware for production config (@ChrisPappalardo) + +## [2018-09-12] +### Fixed +- URLs for Static and Media for S3 buckets in regions other than N. Virginia (@umrashrf) + +## [2018-09-09] +### Changed +- Name of static and media storage classes (@sfdye) + +## [2018-09-01] +### Changed +- Make static and media storage fully-fledged classes (@erfaan) + +## [2018-08-28] +### Fixed +- Running tests in docker test script (@apirobot) + +## [2018-07-23] +### Changed +- Test commands to use pytest (@jcass77) + +### Removed +- Some hacks leftovers from Bootstrap v4 beta in `project.js` (@hendrikschneider) + +## [2018-07-12] +### Changed +- Upgraded to Bootstrap 4.1.1 (@mostaszewski) + +## [2018-06-25] +### Added +- Flower integration with Docker (@webyneter) + +## [2018-06-25] +### Changed +- Rewrite user app test to use a pytest style (@webyneter) + +## [2018-06-21] +### Added +- Extend & update Celery config (@webyneter & @apirobot) + +## [2018-05-25] +### Fixed +- Build issues due to incompatibility between libressl & openssl (@SassanoM) + +## [2018-05-21] +### Changed +- Updated Caddy to 0.11 and pin its version (@webyneter) + +## [2018-05-14] +### Changed +- Replace `awesome-slugify` by `python-slugify` (@hongquan) +- Migrate to Django 2.0+ URL style (@saschalalala) + +## [2018-05-05] +### Fixed +- Postgres backup & restore commands (@webyneter) + +## [2018-04-10] +### Changed +- Simplify configuration (@danidee10) + +## [2018-04-08] +### Added +- Adopt Black code style (@pydanny) + +## [2018-03-27] +### Fixed +- Simplified extra Celery config generated when opted out (@webyneter) + +## [2018-03-21] +### Removed +- Remove Opbeat support (@sfdye) + +## [2018-03-16] +### Fixed +- Install `psycopg2-binary` when using Docker locally (@browniebroke) + +## [2018-03-14] +### Fixed +- Fixed and improved Postgres backup & restore scripts (@webyneter) + +## [2018-03-10] +### Changed +- Simplify Mailgun setting (@browniebroke) + +## [2018-03-06] +### Changed +- Convert string formatting to f-strings (@sfdye) + +## [2018-03-01] +### Changed +- Celery to use JSON serialization by default (@adammsteele) +- Use Docker version from Travis to run tests (@browniebroke) + ## [2018-02-16] ### Changed - Upgraded to Django 2.0 (@epicwhale) From 3b96afc559302d9ebf91bae5bd776281bda4471e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 12 May 2019 21:57:16 +0100 Subject: [PATCH 30/90] Deduplicate troubleshooting sections about Mailgun --- docs/troubleshooting.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 68db2fb08..b6a93ffca 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -9,9 +9,9 @@ This page contains some advice about errors and problems commonly encountered du #. Internal server error on user registration: make sure you have configured the mail backend (e.g. Mailgun) by adding the API key and sender domain -#. New apps not getting created in project root: This is the expected behavior, because cookiecutter-django does not change the way that django startapp works, you'll have to fix this manually (see `#1725`_) + .. include:: mailgun.rst -#. .. include:: mailgun.rst +#. New apps not getting created in project root: This is the expected behavior, because cookiecutter-django does not change the way that django startapp works, you'll have to fix this manually (see `#1725`_) .. _#528: https://github.com/pydanny/cookiecutter-django/issues/528#issuecomment-212650373 .. _#1725: https://github.com/pydanny/cookiecutter-django/issues/1725#issuecomment-407493176 From dac16d6c404af93ab054506fd246dae5461a3fa7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 13 May 2019 16:15:56 -0700 Subject: [PATCH 31/90] Update tox from 3.9.0 to 3.10.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9391b0c6f..42dd9ee6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.9.0 +tox==3.10.0 pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 From 74aaa3022c1a84a0fc0329c89e527b0c0b993e70 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 15 May 2019 12:00:38 +0100 Subject: [PATCH 32/90] Update werkzeug from 0.15.2 to 0.15.4 --- {{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 6327cf8c5..5fc26c15e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r ./base.txt -Werkzeug==0.15.2 # https://github.com/pallets/werkzeug +Werkzeug==0.15.4 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From a245651f668bc411576039f54cf43220b4c29693 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 15 May 2019 12:37:17 +0100 Subject: [PATCH 33/90] Increase test parallelism - Split out tests and add markers to control where they are run in Travis - Run each marker on a separate Travis task - Install pytest-xdist to increase parallelism inside each worker - Set xdist parallelism to 3 --- .travis.yml | 8 ++++++-- requirements.txt | 1 + tests/test_cookiecutter_generation.py | 15 +++++++++++++-- tox.ini | 12 ++++++++++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index a74090b28..f16c65820 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,14 @@ before_install: matrix: include: - - name: Tox Test + - name: Test results script: tox -e py36 - - name: Black template + - name: Run flake8 on result + script: tox -e flake8 + - name: Run black on result script: tox -e black + - name: Black template + script: tox -e black-template - name: Basic Docker script: sh tests/test_docker.sh - name: Docker with Celery diff --git a/requirements.txt b/requirements.txt index 42dd9ee6a..121ba87f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ tox==3.10.0 pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 +pytest-xdist==1.28.0 pyyaml==5.1 diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 17375b1cf..2be23b86a 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -101,9 +101,10 @@ def test_project_generation(cookies, context, context_combination): check_paths(paths) -def test_linting_passes(cookies, context_combination): +@pytest.mark.flake8 +def test_flake8_passes(cookies, context_combination): """ - Generated project should pass flake8 & black. + Generated project should pass flake8. This is parametrized for each combination from ``context_combination`` fixture """ @@ -114,6 +115,16 @@ def test_linting_passes(cookies, context_combination): except sh.ErrorReturnCode as e: pytest.fail(e) + +@pytest.mark.black +def test_black_passes(cookies, context_combination): + """ + Generated project should pass black. + + This is parametrized for each combination from ``context_combination`` fixture + """ + result = cookies.bake(extra_context=context_combination) + try: sh.black("--check", "--diff", "--exclude", "migrations", f"{result.project}/") except sh.ErrorReturnCode as e: diff --git a/tox.ini b/tox.ini index cef3efc78..8306ccf2f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,19 @@ [tox] skipsdist = true -envlist = py36,black +envlist = py36,flake8,black,black-template [testenv] deps = -rrequirements.txt -commands = pytest {posargs:./tests} +commands = pytest -n 3 -m "not flake8" -m "not black" {posargs:./tests} + +[testenv:flake8] +deps = -rrequirements.txt +commands = pytest -n 3 -m flake8 {posargs:./tests} [testenv:black] +deps = -rrequirements.txt +commands = pytest -n 3 -m black {posargs:./tests} + +[testenv:black-template] deps = black commands = black --check hooks tests setup.py docs From 0fef8283755fe5e89e44c3e4287f5c2f7ab3f534 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 12 Apr 2019 16:59:34 +0100 Subject: [PATCH 34/90] Create a logging config in base settings & add a root logger to existing ones --- .../config/settings/base.py | 24 +++++++++++++++++++ .../config/settings/production.py | 2 ++ 2 files changed, 26 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 026c88cf5..734c1c807 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -221,6 +221,30 @@ ADMINS = [("""{{cookiecutter.author_name}}""", "{{cookiecutter.email}}")] # https://docs.djangoproject.com/en/dev/ref/settings/#managers MANAGERS = ADMINS +# LOGGING +# ------------------------------------------------------------------------------ +# https://docs.djangoproject.com/en/dev/ref/settings/#logging +# See https://docs.djangoproject.com/en/dev/topics/logging for +# more details on how to customize your logging configuration. +LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "formatters": { + "verbose": { + "format": "%(levelname)s %(asctime)s %(module)s " + "%(process)d %(thread)d %(message)s" + } + }, + "handlers": { + "console": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "formatter": "verbose", + } + }, + "root": {"level": "INFO", "handlers": ["console"]}, +} + {% if cookiecutter.use_celery == 'y' -%} # Celery # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 63225bee9..61fb38d6e 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -233,6 +233,7 @@ LOGGING = { "formatter": "verbose", }, }, + "root": {"level": "INFO", "handlers": ["console"]}, "loggers": { "django.request": { "handlers": ["mail_admins"], @@ -263,6 +264,7 @@ LOGGING = { "formatter": "verbose", } }, + "root": {"level": "INFO", "handlers": ["console"]}, "loggers": { "django.db.backends": { "level": "ERROR", From 78d81d6f87803cca64e9f693f9b32ab7f39a7070 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 15 May 2019 10:45:37 -0700 Subject: [PATCH 35/90] Update tox from 3.10.0 to 3.11.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 121ba87f0..608cd6b52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.10.0 +tox==3.11.0 pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 From d00517252c42c6d038356fff42a2056392de2d77 Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Wed, 15 May 2019 13:11:16 -0300 Subject: [PATCH 36/90] UsersAppConfig improvements + Rename to UsersConfig to follow Django naming convention + Translate verbose_name --- {{cookiecutter.project_slug}}/config/settings/base.py | 2 +- .../{{cookiecutter.project_slug}}/users/apps.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 026c88cf5..3d51729f5 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -75,7 +75,7 @@ THIRD_PARTY_APPS = [ "rest_framework", ] LOCAL_APPS = [ - "{{ cookiecutter.project_slug }}.users.apps.UsersAppConfig", + "{{ cookiecutter.project_slug }}.users.apps.UsersConfig", # Your stuff: custom apps go here ] # https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py index ded2072ff..2241e5eb5 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/apps.py @@ -1,10 +1,10 @@ from django.apps import AppConfig +from django.utils.translation import gettext_lazy as _ -class UsersAppConfig(AppConfig): - +class UsersConfig(AppConfig): name = "{{ cookiecutter.project_slug }}.users" - verbose_name = "Users" + verbose_name = _("Users") def ready(self): try: From 6d0d33865c33cca7f002b1caf8aa835c6dd46623 Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Wed, 15 May 2019 19:22:08 -0300 Subject: [PATCH 37/90] Add myself as contributor and sort the list --- CONTRIBUTORS.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 6fa9e1c0d..af974d5ee 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -64,6 +64,7 @@ Listed in alphabetical order. Areski Belaid `@areski`_ Ashley Camba Barclay Gauld `@yunti`_ + Bartek `@btknu`_ Ben Warren `@bwarren2`_ Ben Lopatin Benjamin Abel @@ -71,7 +72,6 @@ Listed in alphabetical order. Bo Lopker `@blopker`_ Bouke Haarsma Brent Payne `@brentpayne`_ @brentpayne - Bartek `@btknu`_ Burhan Khalid            `@burhan`_                   @burhan Carl Johnson `@carlmjohnson`_ @carlmjohnson Catherine Devlin `@catherinedevlin`_ @@ -95,6 +95,7 @@ Listed in alphabetical order. Davur Clementsen `@dsclementsen`_ @davur Delio Castillo `@jangeador`_ @jangeador Demetris Stavrou `@demestav`_ + Denis Bobrov `@delneg`_ Denis Orehovsky `@apirobot`_ Dónal Adams `@epileptic-fish`_ Diane Chen `@purplediane`_ @purplediane88 @@ -114,8 +115,8 @@ Listed in alphabetical order. Ian Lee `@IanLee1521`_ Irfan Ahmad `@erfaan`_ @erfaan Jan Van Bruggen `@jvanbrug`_ - Jens Nilsson `@phiberjenz`_ Jelmer Draaijer `@foarsitter`_ + Jens Nilsson `@phiberjenz`_ Jerome Leclanche `@jleclanche`_ @Adys Jimmy Gitonga `@afrowave`_ @afrowave John Cass `@jcass77`_ @cass_john @@ -124,9 +125,10 @@ Listed in alphabetical order. Kaido Kert `@kaidokert`_ kappataumu `@kappataumu`_ @kappataumu Kaveh `@ka7eh`_ + Keith Bailey `@keithjeb`_ + Keith Webber `@townie`_ Kevin A. Stone Kevin Ndung'u `@kevgathuku`_ - Keith Webber `@townie`_ Krzysztof Szumny `@noisy`_ Krzysztof Żuraw `@krzysztofzuraw`_ Leonardo Jimenez `@xpostudio4`_ @@ -154,22 +156,24 @@ Listed in alphabetical order. Parbhat Puri `@parbhat`_ Peter Bittner `@bittner`_ Peter Coles `@mrcoles`_ + Philipp Matthies `@canonnervio`_ Pierre Chiquet `@pchiquet`_ - Raphael Pierzina `@hackebrot`_ Raony Guimarães Corrêa `@raonyguimaraes`_ + Raphael Pierzina `@hackebrot`_ Reggie Riser `@reggieriser`_ René Muhl `@rm--`_ Roman Afanaskin `@siauPatrick`_ Roman Osipenko `@romanosipenko`_ Russell Davies - Sascha `@saschalalala`_ @saschalalala Sam Collins `@MightySCollins`_ + Sascha `@saschalalala`_ @saschalalala Shupeyko Nikita `@webyneter`_ Sławek Ehlert `@slafs`_ Srinivas Nyayapati `@shireenrao`_ stepmr `@stepmr`_ Steve Steiner `@ssteinerX`_ Sule Marshall `@suledev`_ + Tano Abeleyra `@tanoabeleyra`_ Taylor Baldwin Théo Segonds `@show0k`_ Tim Freund `@timfreund`_ @@ -178,16 +182,13 @@ Listed in alphabetical order. Travis McNeill `@Travistock`_ @tavistock_esq Tubo Shi `@Tubo`_ Umair Ashraf `@umrashrf`_ @fabumair - Vlad Doster `@vladdoster`_ + Vadim Iskuchekov `@Egregors`_ @egregors Vitaly Babiy Vivian Guillen `@viviangb`_ + Vlad Doster `@vladdoster`_ Will Farley `@goldhand`_ @g01dhand William Archinal `@archinal`_ Yaroslav Halchenko - Denis Bobrov `@delneg`_ - Philipp Matthies `@canonnervio`_ - Vadim Iskuchekov `@Egregors`_ @egregors - Keith Bailey `@keithjeb`_ ========================== ============================ ============== .. _@a7p: https://github.com/a7p From c3f6df2eae4604305cb22e22d6bd5dc403cbb15e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 16 May 2019 12:00:38 +0100 Subject: [PATCH 38/90] Update tox from 3.11.0 to 3.11.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 608cd6b52..53d143788 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.11.0 +tox==3.11.1 pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 From 04cf607166a31c2b534d753b37b1e6d75702373f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 16 May 2019 13:27:51 +0100 Subject: [PATCH 39/90] Add recent changes to changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e59b3b4a..e4eadd221 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/). +## [2019-05-16] +### Changed +- Users app to have a translated verbose name (@tanoabeleyra) +- Logging configuration for local (@browniebroke) + ## [2019-05-08] ### Changed - Upgraded to Django 2.1 (@browniebroke) From dc55a3cdd41adb2d97639cc5560b09b85d10eecd Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Thu, 16 May 2019 21:18:41 -0300 Subject: [PATCH 40/90] Add missing link in CONTRIBUTORS (#2058) --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index af974d5ee..d11f99050 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -320,6 +320,7 @@ Listed in alphabetical order. .. _@hanaquadara: https://github.com/hanaquadara .. _@vladdoster: https://github.com/vladdoster .. _@cmargieson: https://github.com/cmargieson +.. _@tanoabeleyra: https://github.com/tanoabeleyra Special Thanks ~~~~~~~~~~~~~~ From ecc5a73affa458c4e6088653156f3662e3295d4b Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Fri, 17 May 2019 11:57:13 -0300 Subject: [PATCH 41/90] Add LocaleMiddleware --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 01881b366..22a08b5ab 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -126,6 +126,7 @@ AUTH_PASSWORD_VALIDATORS = [ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.locale.LocaleMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", From 63a184f07247752de53082bf2a2a5a61d637390d Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Fri, 17 May 2019 12:34:32 -0300 Subject: [PATCH 42/90] Set LOCALE_PATHS --- {{cookiecutter.project_slug}}/config/settings/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 22a08b5ab..0e0d96160 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -35,6 +35,8 @@ USE_I18N = True USE_L10N = True # https://docs.djangoproject.com/en/dev/ref/settings/#use-tz USE_TZ = True +# https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths +LOCALE_PATHS = [ROOT_DIR.path("locale")] # DATABASES # ------------------------------------------------------------------------------ From dc664b355615fdb1f0f5db8d5fc784f52611dd23 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 May 2019 21:37:14 +0100 Subject: [PATCH 43/90] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4eadd221..89e5d0153 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/). +## [2019-05-17] +### Fixed +- Added `LocaleMiddleware` to the list of middlewares (@tanoabeleyra) +- Added `LOCALE_PATH` to settings (@tanoabeleyra) + ## [2019-05-16] ### Changed - Users app to have a translated verbose name (@tanoabeleyra) From 219062cb2b8b3ae5b83bedb4827b8e529bfba8b4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 12 May 2019 21:55:22 +0100 Subject: [PATCH 44/90] Update to Django 2.2.1 --- README.rst | 2 +- setup.py | 6 +++--- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 8a92eddae..3434e09d5 100644 --- a/README.rst +++ b/README.rst @@ -36,7 +36,7 @@ production-ready Django projects quickly. Features --------- -* For Django 2.1 +* For Django 2.2 * Works with Python 3.6 * Renders Django projects with 100% starting test coverage * Twitter Bootstrap_ v4 (`maintained Foundation fork`_ also available) diff --git a/setup.py b/setup.py index 65bcd8fcf..46c84b712 100644 --- a/setup.py +++ b/setup.py @@ -10,10 +10,10 @@ 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 = "2.0.2" +version = "2.2.1" if sys.argv[-1] == "tag": - os.system('git tag -a %s -m "version %s"' % (version, version)) + os.system(f'git tag -a {version} -m "version {version}"') os.system("git push --tags") sys.exit() @@ -34,7 +34,7 @@ setup( classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", - "Framework :: Django :: 2.0", + "Framework :: Django :: 2.2", "Intended Audience :: Developers", "Natural Language :: English", "License :: OSI Approved :: BSD License", diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 29e7f2b94..ddd8f041c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -18,7 +18,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.1.8 # pyup: < 2.2 # https://www.djangoproject.com/ +django==2.2.1 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.1.2 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth From 872204527f39386d687edf1e8ceffea56f76d211 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 May 2019 22:33:30 +0100 Subject: [PATCH 45/90] Remove user list view --- .../users/tests/test_urls.py | 5 ----- .../{{cookiecutter.project_slug}}/users/urls.py | 2 -- .../{{cookiecutter.project_slug}}/users/views.py | 12 +----------- 3 files changed, 1 insertion(+), 18 deletions(-) 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 20bd3dbad..c6361920d 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 @@ -13,11 +13,6 @@ def test_detail(user: settings.AUTH_USER_MODEL): assert resolve(f"/users/{user.username}/").view_name == "users:detail" -def test_list(): - assert reverse("users:list") == "/users/" - assert resolve("/users/").view_name == "users:list" - - def test_update(): assert reverse("users:update") == "/users/~update/" assert resolve("/users/~update/").view_name == "users:update" diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 2502a0c0c..eff24dd04 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -1,7 +1,6 @@ from django.urls import path from {{ cookiecutter.project_slug }}.users.views import ( - user_list_view, user_redirect_view, user_update_view, user_detail_view, @@ -9,7 +8,6 @@ from {{ cookiecutter.project_slug }}.users.views import ( app_name = "users" urlpatterns = [ - path("", view=user_list_view, name="list"), path("~redirect/", view=user_redirect_view, name="redirect"), path("~update/", view=user_update_view, name="update"), path("/", view=user_detail_view, name="detail"), diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 35e26e94f..a24427416 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -1,7 +1,7 @@ from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse -from django.views.generic import DetailView, ListView, RedirectView, UpdateView +from django.views.generic import DetailView, RedirectView, UpdateView User = get_user_model() @@ -16,16 +16,6 @@ class UserDetailView(LoginRequiredMixin, DetailView): user_detail_view = UserDetailView.as_view() -class UserListView(LoginRequiredMixin, ListView): - - model = User - slug_field = "username" - slug_url_kwarg = "username" - - -user_list_view = UserListView.as_view() - - class UserUpdateView(LoginRequiredMixin, UpdateView): model = User From e6458d7c0732860479399d4429163af727ddfe00 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 May 2019 22:37:35 +0100 Subject: [PATCH 46/90] Update flake8 from 3.7.6 to 3.7.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 53d143788..02caf6eba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ black==19.3b0 -flake8==3.7.6 +flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ From 99df05d8b0dc3b0b82167537e000b40cf67fc876 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 18 May 2019 12:00:28 +0100 Subject: [PATCH 47/90] Update sentry-sdk from 0.7.14 to 0.8.0 --- {{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 4ae99be3f..67c44c8fa 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.7.14 # https://github.com/getsentry/sentry-python +sentry-sdk==0.8.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 093455a120cf6e23b11816c588b60518e6b8e3f3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 18 May 2019 12:00:31 +0100 Subject: [PATCH 48/90] Update flake8 from 3.7.5 to 3.7.7 --- {{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 5fc26c15e..ddab6ab1d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -17,7 +17,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ -flake8==3.7.5 # https://github.com/PyCQA/flake8 +flake8==3.7.7 # https://github.com/PyCQA/flake8 coverage==4.5.3 # https://github.com/nedbat/coveragepy black==19.3b0 # https://github.com/ambv/black pylint-django==2.0.9 # https://github.com/PyCQA/pylint-django From 88243d088d443c5fb9036cbe74f7f1d8ab4b6e0e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 13:08:30 +0100 Subject: [PATCH 49/90] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e5d0153..449ce643b 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/). +## [2019-05-18] +### Removed +- Remove the user list view (@browniebroke) + ## [2019-05-17] ### Fixed - Added `LocaleMiddleware` to the list of middlewares (@tanoabeleyra) From 642c28792c0e697dfa618169e37722b185ade224 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 13:22:50 +0100 Subject: [PATCH 50/90] Update Redis version to 5.0 --- {{cookiecutter.project_slug}}/local.yml | 2 +- {{cookiecutter.project_slug}}/production.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index c6dd654e5..60f8f9228 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -45,7 +45,7 @@ services: {%- if cookiecutter.use_celery == 'y' %} redis: - image: redis:3.2 + image: redis:5.0 celeryworker: <<: *django diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index a24ba8297..331cbba68 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -44,7 +44,7 @@ services: - "0.0.0.0:443:443" redis: - image: redis:3.2 + image: redis:5.0 {%- if cookiecutter.use_celery == 'y' %} celeryworker: From d90406c3c3489c896407b09fada43ccfbae544a7 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 14:06:05 +0100 Subject: [PATCH 51/90] Make the static storage use public ACL --- {{cookiecutter.project_slug}}/config/settings/production.py | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 61fb38d6e..6b79b0af7 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -117,6 +117,7 @@ from storages.backends.s3boto3 import S3Boto3Storage # noqa E402 class StaticRootS3Boto3Storage(S3Boto3Storage): location = "static" + default_acl = "public-read" class MediaRootS3Boto3Storage(S3Boto3Storage): From e74e2a8ad39dfde2712e5f508a294f9a0defb654 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 18 May 2019 14:08:02 +0100 Subject: [PATCH 52/90] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 449ce643b..51ad4472f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed - Remove the user list view (@browniebroke) +### Fixed +- Static storage default ACL (@browniebroke) + ## [2019-05-17] ### Fixed - Added `LocaleMiddleware` to the list of middlewares (@tanoabeleyra) From 98012829f3c5a2dbfa7962f744590685513de956 Mon Sep 17 00:00:00 2001 From: Matt Knapper Date: Sat, 18 May 2019 10:10:45 -0400 Subject: [PATCH 53/90] storageFile is deprecated, use storage instead --- CONTRIBUTORS.rst | 2 ++ .../compose/production/traefik/traefik.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index d11f99050..bd748062d 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -143,6 +143,7 @@ Listed in alphabetical order. Mateusz Ostaszewski `@mostaszewski`_ Mathijs Hoogland `@MathijsHoogland`_ Matt Braymer-Hayes `@mattayes`_ @mattayes + Matt Knapper `@mknapper1`_ Matt Linares Matt Menzenski `@menzenski`_ Matt Warren `@mfwarren`_ @@ -260,6 +261,7 @@ Listed in alphabetical order. .. _@msaizar: https://github.com/msaizar .. _@MathijsHoogland: https://github.com/MathijsHoogland .. _@mattayes: https://github.com/mattayes +.. _@mknapper1: https://github.com/mknapper1 .. _@menzenski: https://github.com/menzenski .. _@mostaszewski: https://github.com/mostaszewski .. _@mfwarren: https://github.com/mfwarren diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml index ad1f20e9e..0f2abe8a1 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml @@ -17,7 +17,7 @@ defaultEntryPoints = ["http", "https"] [acme] # Email address used for registration email = "{{ cookiecutter.email }}" -storageFile = "/etc/traefik/acme/acme.json" +storage = "/etc/traefik/acme/acme.json" entryPoint = "https" onDemand = false OnHostRule = true From 570930ef135ce4d195b02167764ecbc74d27fb69 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sat, 18 May 2019 22:49:10 -0400 Subject: [PATCH 54/90] If using whitenoise disable AWS and GCE for static If using whitenoise disable AWS and GCE for static setting. --- {{cookiecutter.project_slug}}/config/settings/production.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 6b79b0af7..0c94b2d8c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -99,11 +99,10 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- endif -%} -{%- if cookiecutter.cloud_provider == 'AWS' %} +{%- elif cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'n' %} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{%- elif cookiecutter.cloud_provider == 'GCE' and cookiecutter.use_whitenoise == 'n' %} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From 0b732298e5d4e4be6569c3903aeef9f697fc4b69 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 19 May 2019 12:00:27 +0100 Subject: [PATCH 55/90] Update django-extensions from 2.1.6 to 2.1.7 --- {{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 ddab6ab1d..24cedfda3 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -30,6 +30,6 @@ pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==1.11 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.1.6 # https://github.com/django-extensions/django-extensions +django-extensions==2.1.7 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.4.8 # https://github.com/pytest-dev/pytest-django From adcc5d0b2889a59aa7e79f8d17e521ed92bee32c Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sun, 19 May 2019 08:27:14 -0400 Subject: [PATCH 56/90] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{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 0c94b2d8c..203612ca1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -99,7 +99,7 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- elif cookiecutter.cloud_provider == 'AWS' and cookiecutter.use_whitenoise == 'n' %} +{%- elif cookiecutter.cloud_provider == 'AWS' %} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {%- elif cookiecutter.cloud_provider == 'GCE' and cookiecutter.use_whitenoise == 'n' %} From 8c69a1203f22ca996c5f2b47ea65e3c51f874ce0 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Sun, 19 May 2019 08:27:28 -0400 Subject: [PATCH 57/90] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{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 203612ca1..1a5889d5d 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -102,7 +102,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {%- elif cookiecutter.cloud_provider == 'AWS' %} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{%- elif cookiecutter.cloud_provider == 'GCE' and cookiecutter.use_whitenoise == 'n' %} +{%- elif cookiecutter.cloud_provider == 'GCE' %} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From de7be3652a82172a45197ab92394e1bd0fa15500 Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Sat, 18 May 2019 20:23:48 -0300 Subject: [PATCH 58/90] Make cloud_provider optional Some projects may not need AWS or GCS --- README.rst | 3 ++- cookiecutter.json | 3 ++- docs/project-generation-options.rst | 1 + hooks/post_gen_project.py | 6 ++++++ tests/test_cookiecutter_generation.py | 2 +- {{cookiecutter.project_slug}}/config/settings/production.py | 4 +++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 8a92eddae..efcfd506a 100644 --- a/README.rst +++ b/README.rst @@ -185,7 +185,8 @@ Answer the prompts with your own desired options_. For example:: Select cloud_provider: 1 - AWS 2 - GCS - Choose from 1, 2 [1]: 1 + 3 - None + Choose from 1, 2, 3 [1]: 1 custom_bootstrap_compilation [n]: n Select open_source_license: 1 - MIT diff --git a/cookiecutter.json b/cookiecutter.json index a66bb732a..d4a977bb1 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -33,7 +33,8 @@ ], "cloud_provider": [ "AWS", - "GCE" + "GCE", + "None" ], "custom_bootstrap_compilation": "n", "use_compressor": "n", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index c3c4d3a2d..3e4ac47c4 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -69,6 +69,7 @@ cloud_provider: 1. AWS_ 2. GCS_ + 3. None custom_bootstrap_compilation: Indicates whether the project should support Bootstrap recompilation diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 292f6e7f6..ff84f1806 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -328,6 +328,12 @@ def main(): if "{{ cookiecutter.use_docker }}".lower() == "y": remove_node_dockerfile() + if "{{ cookiecutter.cloud_provider}}".lower() == "none": + print( + WARNING + "You chose not to use a cloud provider, " + "media files won't be served in production." + TERMINATOR + ) + if "{{ cookiecutter.use_celery }}".lower() == "n": remove_celery_files() if "{{ cookiecutter.use_docker }}".lower() == "y": diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 2be23b86a..be05e79b1 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -11,7 +11,7 @@ PATTERN = "{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) YN_CHOICES = ["y", "n"] -CLOUD_CHOICES = ["AWS", "GCE"] +CLOUD_CHOICES = ["AWS", "GCE", "None"] @pytest.fixture diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 1a5889d5d..c2fcd5750 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -68,8 +68,10 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( # STORAGES # ------------------------------------------------------------------------------ +{% if cookiecutter.cloud_provider != 'None' -%} # https://django-storages.readthedocs.io/en/latest/#installation INSTALLED_APPS += ["storages"] # noqa F405 +{%- endif -%} {% if cookiecutter.cloud_provider == 'AWS' %} # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_ACCESS_KEY_ID = env("DJANGO_AWS_ACCESS_KEY_ID") @@ -193,7 +195,7 @@ COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True) # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL -COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' %} # noqa F405{% endif %} +COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' or cookiecutter.cloud_provider == 'None' %} # noqa F405{% endif %} {% endif %} {%- if cookiecutter.use_whitenoise == 'n' -%} # Collectfast From 2116f997bcb11e6ca00b4c09e07546b606f677b3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 20 May 2019 12:00:32 +0100 Subject: [PATCH 59/90] Update django-anymail from 6.0 to 6.0.1 --- {{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 67c44c8fa..e62eeb73c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -18,4 +18,4 @@ django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCE' %} django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages {%- endif %} -django-anymail[mailgun]==6.0 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==6.0.1 # https://github.com/anymail/django-anymail From 4bf795a908d49cf0135625990006baa568393fdb Mon Sep 17 00:00:00 2001 From: Curtis St Pierre Date: Sun, 19 May 2019 21:29:15 -0700 Subject: [PATCH 60/90] 1989 - reworked postgres version options --- CONTRIBUTORS.rst | 26 ++++++++++++++------------ README.rst | 17 +++++++---------- cookiecutter.json | 7 ++----- docs/project-generation-options.rst | 15 ++++++--------- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index bd748062d..7a9dbf79c 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -7,19 +7,19 @@ Core Developers These contributors have commit flags for the repository, and are able to accept and merge pull requests. -=========================== ================ =========== -Name Github Twitter -=========================== ================ =========== -Daniel Roy Greenfeld `@pydanny`_ @pydanny -Audrey Roy Greenfeld* `@audreyr`_ @audreyr -Fábio C. Barrionuevo da Luz `@luzfcb`_ @luzfcb -Saurabh Kumar `@theskumar`_ @_theskumar +=========================== ================= =========== +Name Github Twitter +=========================== ================= =========== +Daniel Roy Greenfeld `@pydanny`_ @pydanny +Audrey Roy Greenfeld* `@audreyr`_ @audreyr +Fábio C. Barrionuevo da Luz `@luzfcb`_ @luzfcb +Saurabh Kumar `@theskumar`_ @_theskumar Jannis Gebauer `@jayfk`_ -Burhan Khalid `@burhan`_ @burhan -Nikita Shupeyko `@webyneter`_ @webyneter -Bruno Alla               `@browniebroke`_ @_BrunoAlla -Wan Liuyang `@sfdye`_ @sfdye -=========================== ================ =========== +Burhan Khalid `@burhan`_ @burhan +Nikita Shupeyko `@webyneter`_ @webyneter +Bruno Alla               `@browniebroke`_ @_BrunoAlla +Wan Liuyang `@sfdye`_ @sfdye +=========================== ================= =========== *Audrey is also the creator of Cookiecutter. Audrey and Daniel are on the Cookiecutter core team.* @@ -87,6 +87,7 @@ Listed in alphabetical order. Craig Margieson `@cmargieson`_ Cristian Vargas `@cdvv7788`_ Cullen Rhodes `@c-rhodes`_ + Curtis St Pierre `@curtisstpierre`_ @cstpierre1388 Dan Shultz `@shultz`_ Daniel Hepper `@dhepper`_ @danielhepper Daniele Tricoli `@eriol`_ @@ -222,6 +223,7 @@ Listed in alphabetical order. .. _@chuckus: https://github.com/chuckus .. _@cmackenzie1: https://github.com/cmackenzie1 .. _@Collederas: https://github.com/Collederas +.. _@curtisstpierre: https://github.com/curtisstpierre .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto .. _@demestav: https://github.com/demestav diff --git a/README.rst b/README.rst index 8a92eddae..d6372de68 100644 --- a/README.rst +++ b/README.rst @@ -89,7 +89,7 @@ Constraints ----------- * Only maintained 3rd party libraries are used. -* Uses PostgreSQL everywhere (9.4 - 10.5) +* Uses PostgreSQL everywhere (9.4 - 11.3) * Environment variables for configuration (This won't work with Apache/mod_wsgi). Support this Project! @@ -169,15 +169,12 @@ Answer the prompts with your own desired options_. For example:: use_heroku [n]: y use_compressor [n]: y Select postgresql_version: - 1 - 10.5 - 2 - 10.4 - 3 - 10.3 - 4 - 10.2 - 5 - 10.1 - 6 - 9.6 - 7 - 9.5 - 8 - 9.4 - Choose from 1, 2, 3, 4, 5, 6, 7, 8 [1]: 1 + 1 - 11.3 + 2 - 10.8 + 3 - 9.6 + 4 - 9.5 + 5 - 9.4 + Choose from 1, 2, 3, 4, 5 [1]: 1 Select js_task_runner: 1 - None 2 - Gulp diff --git a/cookiecutter.json b/cookiecutter.json index a66bb732a..cfb20f6be 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -18,11 +18,8 @@ "use_pycharm": "n", "use_docker": "n", "postgresql_version": [ - "10.5", - "10.4", - "10.3", - "10.2", - "10.1", + "11.3", + "10.8", "9.6", "9.5", "9.4" diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index c3c4d3a2d..6f2a2f224 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -49,14 +49,11 @@ use_docker: postgresql_version: Select a PostgreSQL_ version to use. The choices are: - 1. 10.5 - 2. 10.4 - 3. 10.3 - 4. 10.2 - 5. 10.1 - 6. 9.6 - 7. 9.5 - 8. 9.4 + 1. 11.3 + 2. 10.8 + 3. 9.6 + 4. 9.5 + 5. 9.4 js_task_runner: Select a JavaScript task runner. The choices are: @@ -100,7 +97,7 @@ use_travisci: keep_local_envs_in_vcs: Indicates whether the project's ``.envs/.local/`` should be kept in VCS (comes in handy when working in teams where local environment reproducibility - is strongly encouraged). + is strongly encouraged). Note: .env(s) are only utilized when Docker Compose and/or Heroku support is enabled. debug: From 38b2c2dfcd44fa7e103c12a276fdc1db4bc1b728 Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Tue, 21 May 2019 22:04:03 +0300 Subject: [PATCH 61/90] Errors are now sent to Sentry --- {{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 1a5889d5d..a132b3b2a 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -288,7 +288,7 @@ SENTRY_LOG_LEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO) sentry_logging = LoggingIntegration( level=SENTRY_LOG_LEVEL, # Capture info and above as breadcrumbs - event_level=None, # Send no events from log messages + event_level=logging.ERROR # Send errors as events ) {%- if cookiecutter.use_celery == 'y' %} From 7cc94c139c81c5ab10e708a23e1e64c086a5fabe Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Tue, 21 May 2019 22:44:10 +0300 Subject: [PATCH 62/90] Updated documentation --- docs/deployment-with-docker.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index aad549327..e69abc010 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -35,7 +35,15 @@ Configuring the Stack The majority of services above are configured through the use of environment variables. Just check out :ref:`envs` and you will know the drill. -To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. +To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. Logs of level `logging.ERROR` are sent as Sentry events. Therefore, in order to send a Sentry even use: + +.. code-block:: python + + import logging + logging.error("This event is sent to Sentry", extra={"": ""}) + +The `extra` parameter allows you to send additional information about the context of this error. + You will probably also need to setup the Mail backend, for example by adding a `Mailgun`_ API key and a `Mailgun`_ sender domain, otherwise, the account creation view will crash and result in a 500 error when the backend attempts to send an email to the account owner. From a37046d1ef9a64642138998a9239023ccd7097b6 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Tue, 21 May 2019 18:17:19 -0400 Subject: [PATCH 63/90] Revert Werkzeug back to 0.14 reverting back Werkzeug to version 0.14 based on discussion on #2070 I did the change locally on my windows laptop and can confirm that this is now working. --- {{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 24cedfda3..57a262c96 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r ./base.txt -Werkzeug==0.15.4 # https://github.com/pallets/werkzeug +Werkzeug==0.14 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From a636d454f619018333d4fd9cd32918fc3ea2beaa Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Wed, 22 May 2019 09:46:20 +0300 Subject: [PATCH 64/90] Update {{cookiecutter.project_slug}}/config/settings/production.py Co-Authored-By: Bruno Alla --- {{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 a132b3b2a..85b17f1b4 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -288,7 +288,7 @@ SENTRY_LOG_LEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO) sentry_logging = LoggingIntegration( level=SENTRY_LOG_LEVEL, # Capture info and above as breadcrumbs - event_level=logging.ERROR # Send errors as events + event_level=logging.ERROR, # Send errors as events ) {%- if cookiecutter.use_celery == 'y' %} From 61c842cd9dd919c33ea927b836660a68ad4bf391 Mon Sep 17 00:00:00 2001 From: Demetris Stavrou <1180929+demestav@users.noreply.github.com> Date: Wed, 22 May 2019 09:47:03 +0300 Subject: [PATCH 65/90] Update docs/deployment-with-docker.rst Co-Authored-By: Bruno Alla --- docs/deployment-with-docker.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index e69abc010..038778cfb 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -35,7 +35,7 @@ Configuring the Stack The majority of services above are configured through the use of environment variables. Just check out :ref:`envs` and you will know the drill. -To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. Logs of level `logging.ERROR` are sent as Sentry events. Therefore, in order to send a Sentry even use: +To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. Logs of level `logging.ERROR` are sent as Sentry events. Therefore, in order to send a Sentry event use: .. code-block:: python From 9e27e853f2c20e319559b39b715e346dbe901779 Mon Sep 17 00:00:00 2001 From: shireenrao Date: Wed, 22 May 2019 09:44:36 -0400 Subject: [PATCH 66/90] update Werkzeug to 0.14.1 and add pyup filter --- {{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 57a262c96..7f856f28c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r ./base.txt -Werkzeug==0.14 # https://github.com/pallets/werkzeug +Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From 4054105d63b04fc938073c039c6e43765ffd5c7e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 23 May 2019 20:33:13 -0700 Subject: [PATCH 67/90] Update tox from 3.11.1 to 3.12.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 02caf6eba..4a6b4b598 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ -tox==3.11.1 +tox==3.12.1 pytest==4.5.0 pytest_cases==1.6.2 pytest-cookies==0.3.0 From a67587bb24cbbd87505fefdf9d62b81408eab00b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 25 May 2019 16:53:08 +0200 Subject: [PATCH 68/90] Bring psycopg2 versions in line --- {{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 7f856f28c..2e2228c39 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} -psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 {%- endif %} From 729dddcab6afacdce49f5ce200af1c1b97ebbbea Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 25 May 2019 16:53:34 +0200 Subject: [PATCH 69/90] Bring psycopg2 versions in line --- {{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 e62eeb73c..43b20513d 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -3,7 +3,7 @@ -r ./base.txt gunicorn==19.9.0 # https://github.com/benoitc/gunicorn -psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} From c96c932111442aaf336f0649b6445561d39961d9 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 14:46:07 +0100 Subject: [PATCH 70/90] Correct name for Celery worker-related settings - fix #2080 The settings which are normally prefixed `CELERYD_` are for worker-related config, but since we instantiate the Celery app with a namespace, the prefix for these config should actually be `CELERY_`. --- {{cookiecutter.project_slug}}/config/settings/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index b72b7f00d..4a522fdda 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -266,10 +266,10 @@ CELERY_TASK_SERIALIZER = "json" CELERY_RESULT_SERIALIZER = "json" # http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-time-limit # TODO: set to whatever value is adequate in your circumstances -CELERYD_TASK_TIME_LIMIT = 5 * 60 +CELERY_TASK_TIME_LIMIT = 5 * 60 # http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-soft-time-limit # TODO: set to whatever value is adequate in your circumstances -CELERYD_TASK_SOFT_TIME_LIMIT = 60 +CELERY_TASK_SOFT_TIME_LIMIT = 60 {%- endif %} # django-allauth From b4cea81f260b686be0678706fa60da4067c86669 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 15:55:41 +0100 Subject: [PATCH 71/90] Fix some comment and empty lines in settings --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index d9771e598..476e0dff1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -66,9 +66,9 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( "DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True ) +{% if cookiecutter.cloud_provider != 'None' -%} # STORAGES # ------------------------------------------------------------------------------ -{% if cookiecutter.cloud_provider != 'None' -%} # https://django-storages.readthedocs.io/en/latest/#installation INSTALLED_APPS += ["storages"] # noqa F405 {%- endif -%} @@ -101,10 +101,10 @@ GS_DEFAULT_ACL = "publicRead" # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- elif cookiecutter.cloud_provider == 'AWS' %} +{% elif cookiecutter.cloud_provider == 'AWS' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{% elif cookiecutter.cloud_provider == 'GCE' -%} STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) {%- endif %} From 881a6fd681abe83dd2a6b4f83782312e7e8ee96f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 15:58:56 +0100 Subject: [PATCH 72/90] Change GCP settings to f-strings --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 476e0dff1..6fd0eac9d 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -105,7 +105,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {% elif cookiecutter.cloud_provider == 'GCE' -%} -STATIC_URL = "https://storage.googleapis.com/{}/static/".format(GS_BUCKET_NAME) +STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {%- endif %} # MEDIA @@ -130,8 +130,8 @@ class MediaRootS3Boto3Storage(S3Boto3Storage): DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootS3Boto3Storage" MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/" {%- elif cookiecutter.cloud_provider == 'GCE' %} -MEDIA_URL = "https://storage.googleapis.com/{}/media/".format(GS_BUCKET_NAME) -MEDIA_ROOT = "https://storage.googleapis.com/{}/media/".format(GS_BUCKET_NAME) +MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" +MEDIA_ROOT = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" {%- endif %} # TEMPLATES From 4b1239426cff1dc380e60ad3cc264cde193856b5 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:20:29 +0100 Subject: [PATCH 73/90] Add custom markers to pytest config --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index c5b301991..01c7b1bfc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,6 @@ [pytest] python_paths = . norecursedirs = .tox .git */migrations/* */static/* docs venv */{{cookiecutter.project_slug}}/* +markers = + flake8: Run flake8 on all possible template combinations + black: Run black on all possible template combinations From b56071f516e9201d957dd9bc5691af339d15fbde Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:33:07 +0100 Subject: [PATCH 74/90] Fix comments and empty lines in prod settings --- {{cookiecutter.project_slug}}/config/settings/production.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 6fd0eac9d..1dbd28801 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -95,10 +95,12 @@ AWS_S3_REGION_NAME = env("DJANGO_AWS_S3_REGION_NAME", default=None) DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" GS_BUCKET_NAME = env("DJANGO_GCE_STORAGE_BUCKET_NAME") GS_DEFAULT_ACL = "publicRead" -{% endif %} +{% endif -%} +{% if cookiecutter.cloud_provider != 'None' or cookiecutter.use_whitenoise == 'y' -%} # STATIC # ------------------------ +{% endif -%} {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} @@ -106,7 +108,7 @@ STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {% elif cookiecutter.cloud_provider == 'GCE' -%} STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" -{%- endif %} +{% endif -%} # MEDIA # ------------------------------------------------------------------------------ From 47937fce7984bc7c5f0e83d4b24f96dbedef5d86 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:54:08 +0100 Subject: [PATCH 75/90] Fix deprecation warning in tests --- tests/test_cookiecutter_generation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index be05e79b1..4292f989b 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -7,7 +7,7 @@ import sh import yaml from binaryornot.check import is_binary -PATTERN = "{{(\s?cookiecutter)[.](.*?)}}" +PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) YN_CHOICES = ["y", "n"] From 761720bce79e8f68db6e0e409d74e906b35d9c0e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 16:57:55 +0100 Subject: [PATCH 76/90] Prepare 2.1.8-01 tag --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 65bcd8fcf..e46cdb883 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 = "2.0.2" +version = "2.1.8-01" if sys.argv[-1] == "tag": os.system('git tag -a %s -m "version %s"' % (version, version)) From c245c1ab09ca9b57c506e3e38a7d6df7eade67e1 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 17:19:24 +0100 Subject: [PATCH 77/90] Update copyright year in the docs --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index e3ddae9a6..469aa12d4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,7 +42,7 @@ master_doc = "index" # General information about the project. project = "Cookiecutter Django" -copyright = "2013-2018, Daniel Roy Greenfeld".format(now.year) +copyright = "2013-{}, Daniel Roy Greenfeld".format(now.year) # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the From 650acf1299f4f3f95186ae8a16a07ce24ad34d2c Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 17:59:13 +0100 Subject: [PATCH 78/90] Update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51ad4472f..f013aec9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2019-05-27] +### Changed +- Made cloud provider optional (@tanoabeleyra) +- Updated to Django 2.2.1 (@browniebroke) + +### Fixed +- Celery worker-related setting names (@browniebroke) + ## [2019-05-18] ### Removed - Remove the user list view (@browniebroke) From 2d1befe8e2eb66a71c7049e1a8eaa3d83469886a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 18:16:00 +0100 Subject: [PATCH 79/90] Update docs about settings --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 1830a47c7..0234ac85c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -49,7 +49,7 @@ DJANGO_GCE_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a GOOGLE_APPLICATION_CREDENTIALS n/a n/a raises error SENTRY_DSN SENTRY_DSN n/a raises error DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO -MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error +MAILGUN_API_KEY MAILGUN_API_KEY n/a raises error MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error ======================================= =========================== ============================================== ====================================================================== From 007f3ffb31ec7c48d6aeaa564548dc5cfe8d7039 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 18:16:51 +0100 Subject: [PATCH 80/90] Docs update --- docs/project-generation-options.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 48a60dbc0..423686908 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -68,6 +68,8 @@ cloud_provider: 2. GCS_ 3. None + Note that if you choose no cloud provider, media files won't work. + custom_bootstrap_compilation: Indicates whether the project should support Bootstrap recompilation via the selected JavaScript task runner's task. This can be useful From 1c5392d334c920eb42f05d09908f1256ef7fe06b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 27 May 2019 21:28:36 +0100 Subject: [PATCH 81/90] Remove deprecated sudo from Travis & use Xenial on CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f16c65820..1be0b743b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: required +dist: xenial services: - docker From 9a3a796a89293c5129cfa9f5bb9d69ad54e54c8b Mon Sep 17 00:00:00 2001 From: Tano Abeleyra Date: Sat, 18 May 2019 20:24:29 -0300 Subject: [PATCH 82/90] Use GCP acronym for Google Cloud Platform --- README.rst | 2 +- cookiecutter.json | 2 +- docs/project-generation-options.rst | 4 ++-- docs/settings.rst | 2 +- {{cookiecutter.project_slug}}/.envs/.production/.django | 6 +++--- .../config/settings/production.py | 8 ++++---- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 7468981c3..30a3a2db4 100644 --- a/README.rst +++ b/README.rst @@ -181,7 +181,7 @@ Answer the prompts with your own desired options_. For example:: Choose from 1, 2 [1]: 1 Select cloud_provider: 1 - AWS - 2 - GCS + 2 - GCP 3 - None Choose from 1, 2, 3 [1]: 1 custom_bootstrap_compilation [n]: n diff --git a/cookiecutter.json b/cookiecutter.json index 15e0aac69..d6d217ca4 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -30,7 +30,7 @@ ], "cloud_provider": [ "AWS", - "GCE", + "GCP", "None" ], "custom_bootstrap_compilation": "n", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 423686908..afa9b8aff 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -65,7 +65,7 @@ cloud_provider: Select a cloud provider for static & media files. The choices are: 1. AWS_ - 2. GCS_ + 2. GCP_ 3. None Note that if you choose no cloud provider, media files won't work. @@ -123,7 +123,7 @@ debug: .. _Gulp: https://github.com/gulpjs/gulp .. _AWS: https://aws.amazon.com/s3/ -.. _GCS: https://cloud.google.com/storage/ +.. _GCP: https://cloud.google.com/storage/ .. _Django Compressor: https://github.com/django-compressor/django-compressor diff --git a/docs/settings.rst b/docs/settings.rst index 0234ac85c..d0edce31f 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -45,7 +45,7 @@ DJANGO_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID n/a DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a raises error DJANGO_AWS_STORAGE_BUCKET_NAME AWS_STORAGE_BUCKET_NAME n/a raises error DJANGO_AWS_S3_REGION_NAME AWS_S3_REGION_NAME n/a None -DJANGO_GCE_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a raises error +DJANGO_GCP_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a raises error GOOGLE_APPLICATION_CREDENTIALS n/a n/a raises error SENTRY_DSN SENTRY_DSN n/a raises error DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index a938ada68..2c2e94f2d 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -22,11 +22,11 @@ MAILGUN_DOMAIN= DJANGO_AWS_ACCESS_KEY_ID= DJANGO_AWS_SECRET_ACCESS_KEY= DJANGO_AWS_STORAGE_BUCKET_NAME= -{% elif cookiecutter.cloud_provider == 'GCE' %} -# GCE +{% elif cookiecutter.cloud_provider == 'GCP' %} +# GCP # ------------------------------------------------------------------------------ GOOGLE_APPLICATION_CREDENTIALS= -DJANGO_GCE_STORAGE_BUCKET_NAME= +DJANGO_GCP_STORAGE_BUCKET_NAME= {% endif %} # django-allauth # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 1dbd28801..2c7b7a121 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -91,9 +91,9 @@ AWS_S3_OBJECT_PARAMETERS = { AWS_DEFAULT_ACL = None # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_S3_REGION_NAME = env("DJANGO_AWS_S3_REGION_NAME", default=None) -{% elif cookiecutter.cloud_provider == 'GCE' %} +{% elif cookiecutter.cloud_provider == 'GCP' %} DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" -GS_BUCKET_NAME = env("DJANGO_GCE_STORAGE_BUCKET_NAME") +GS_BUCKET_NAME = env("DJANGO_GCP_STORAGE_BUCKET_NAME") GS_DEFAULT_ACL = "publicRead" {% endif -%} @@ -106,7 +106,7 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" -{% elif cookiecutter.cloud_provider == 'GCE' -%} +{% elif cookiecutter.cloud_provider == 'GCP' -%} STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% endif -%} @@ -131,7 +131,7 @@ class MediaRootS3Boto3Storage(S3Boto3Storage): # endregion DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootS3Boto3Storage" MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/" -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{%- elif cookiecutter.cloud_provider == 'GCP' %} MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" MEDIA_ROOT = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 43b20513d..e8636fb8f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -15,7 +15,7 @@ sentry-sdk==0.8.0 # https://github.com/getsentry/sentry-python # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages -{%- elif cookiecutter.cloud_provider == 'GCE' %} +{%- elif cookiecutter.cloud_provider == 'GCP' %} django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages {%- endif %} django-anymail[mailgun]==6.0.1 # https://github.com/anymail/django-anymail From 4196d7e52fc5a14df7443195b3cf28bf19d045d3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 29 May 2019 12:00:37 +0100 Subject: [PATCH 83/90] Update pytest_cases from 1.6.2 to 1.6.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4a6b4b598..5089594cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.7 # ------------------------------------------------------------------------------ tox==3.12.1 pytest==4.5.0 -pytest_cases==1.6.2 +pytest_cases==1.6.3 pytest-cookies==0.3.0 pytest-xdist==1.28.0 pyyaml==5.1 From 3de1715b121dbe6665f793e330499a7cf10a150c Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 29 May 2019 14:54:18 +0100 Subject: [PATCH 84/90] Add troubleshooting section regarding Posgres auth issues - fixes #1678 --- docs/developing-locally-docker.rst | 6 +++++ docs/troubleshooting.rst | 42 +++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index da4e67aa7..562dc439f 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -6,6 +6,12 @@ Getting Up and Running Locally With Docker The steps below will get you up and running with a local development environment. All of these commands assume you are in the root of your generated project. +.. note:: + + If you're new to Docker, please be aware that some resources are cached system-wide + and might reappear if you generate a project multiple times with the same name (e.g. + :ref:`this issue with Postgres `). + Prerequisites ------------- diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index b6a93ffca..baabd494f 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -3,14 +3,48 @@ Troubleshooting This page contains some advice about errors and problems commonly encountered during the development of Cookiecutter Django applications. +Server Error on sign-up/log-in +------------------------------ + +Make sure you have configured the mail backend (e.g. Mailgun) by adding the API key and sender domain + +.. include:: mailgun.rst + +.. _docker-posgres-auth-failed: + +Docker: Postgres authentication failed +-------------------------------------- + +Examples of logs:: + + postgres_1 | 2018-06-07 19:11:23.963 UTC [81] FATAL: password authentication failed for user "pydanny" + postgres_1 | 2018-06-07 19:11:23.963 UTC [81] DETAIL: Password does not match for user "pydanny". + postgres_1 | Connection matched pg_hba.conf line 95: "host all all all md5" + +If you recreate the project multiple times with the same name, Docker would preserve the volumes for the postgres container between projects. Here is what happens: + +#. You generate the project the first time. The .env postgres file is populated with the random password +#. You run the docker-compose and the containers are created. The postgres container creates the database based on the .env file credentials +#. You "regenerate" the project with the same name, so the postgres .env file is populated with a new random password +#. You run docker-compose. Since the names of the containers are the same, docker will try to start them (not create them from scratch i.e. it won't execute the Dockerfile to recreate the database). When this happens, it tries to start the database based on the new credentials which do not match the ones that the database was created with, and you get the error message above. + +To fix this, you can either: + +- Clear your project-related Docker cache with ``docker-compose -f local.yml down --volumes --rmi all``. +- Use the Docker volume sub-commands to find volumes (`ls`_) and remove them (`rm`_). +- Use the `prune`_ command to clear system-wide (use with care!). + +.. _ls: https://docs.docker.com/engine/reference/commandline/volume_ls/ +.. _rm: https://docs.docker.com/engine/reference/commandline/volume_rm/ +.. _prune: https://docs.docker.com/v17.09/engine/reference/commandline/system_prune/ + +Others +------ + #. ``project_slug`` must be a valid Python module name or you will have issues on imports. #. ``jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'now'.``: please upgrade your cookiecutter version to >= 1.4 (see `#528`_) -#. Internal server error on user registration: make sure you have configured the mail backend (e.g. Mailgun) by adding the API key and sender domain - - .. include:: mailgun.rst - #. New apps not getting created in project root: This is the expected behavior, because cookiecutter-django does not change the way that django startapp works, you'll have to fix this manually (see `#1725`_) .. _#528: https://github.com/pydanny/cookiecutter-django/issues/528#issuecomment-212650373 From d04b128e0fb508b1832e271f09dbe45d1875e837 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 29 May 2019 14:55:38 +0100 Subject: [PATCH 85/90] Typo in doc reference --- docs/developing-locally-docker.rst | 2 +- docs/troubleshooting.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 562dc439f..09e684986 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -10,7 +10,7 @@ All of these commands assume you are in the root of your generated project. If you're new to Docker, please be aware that some resources are cached system-wide and might reappear if you generate a project multiple times with the same name (e.g. - :ref:`this issue with Postgres `). + :ref:`this issue with Postgres `). Prerequisites diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index baabd494f..8aa1b1f9b 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -10,7 +10,7 @@ Make sure you have configured the mail backend (e.g. Mailgun) by adding the API .. include:: mailgun.rst -.. _docker-posgres-auth-failed: +.. _docker-postgres-auth-failed: Docker: Postgres authentication failed -------------------------------------- From f8d2eb11a958823689f8f6aac4590ae1b4edaf4f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 31 May 2019 10:02:42 +0100 Subject: [PATCH 86/90] Improve error reporting by pytest inside of Tox --- pytest.ini | 1 + tox.ini | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pytest.ini b/pytest.ini index 01c7b1bfc..89aeb302c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] +addopts = -x --tb=short python_paths = . norecursedirs = .tox .git */migrations/* */static/* docs venv */{{cookiecutter.project_slug}}/* markers = diff --git a/tox.ini b/tox.ini index 8306ccf2f..7ee939158 100644 --- a/tox.ini +++ b/tox.ini @@ -4,15 +4,15 @@ envlist = py36,flake8,black,black-template [testenv] deps = -rrequirements.txt -commands = pytest -n 3 -m "not flake8" -m "not black" {posargs:./tests} +commands = pytest -m "not flake8" -m "not black" {posargs:./tests} [testenv:flake8] deps = -rrequirements.txt -commands = pytest -n 3 -m flake8 {posargs:./tests} +commands = pytest -m flake8 {posargs:./tests} [testenv:black] deps = -rrequirements.txt -commands = pytest -n 3 -m black {posargs:./tests} +commands = pytest -m black {posargs:./tests} [testenv:black-template] deps = black From 3e7b60c8937ce8940f3ea135daf37c80c64f170e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 31 May 2019 12:00:33 +0100 Subject: [PATCH 87/90] Update django-compressor from 2.2 to 2.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 ddd8f041c..88331996e 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -24,7 +24,7 @@ django-model-utils==3.1.2 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth django-crispy-forms==1.7.2 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} -django-compressor==2.2 # https://github.com/django-compressor/django-compressor +django-compressor==2.3 # https://github.com/django-compressor/django-compressor {%- endif %} django-redis==4.10.0 # https://github.com/niwinz/django-redis From 53994b4f1668b6560e2f592b20f32bbea7c86877 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 2 Jun 2019 12:00:29 +0100 Subject: [PATCH 88/90] Update pytest from 4.5.0 to 4.6.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5089594cc..d6049ecbb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ tox==3.12.1 -pytest==4.5.0 +pytest==4.6.0 pytest_cases==1.6.3 pytest-cookies==0.3.0 pytest-xdist==1.28.0 From cd7bf6af04de1251bdc1b2459424b57804b87dad Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 2 Jun 2019 12:00:30 +0100 Subject: [PATCH 89/90] Update pytest from 4.5.0 to 4.6.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 2e2228c39..e08cfc97d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.701 # https://github.com/python/mypy -pytest==4.5.0 # https://github.com/pytest-dev/pytest +pytest==4.6.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 8e007111da9efe72f804d556580888d154dcf9a4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 2 Jun 2019 12:00:33 +0100 Subject: [PATCH 90/90] Update sentry-sdk from 0.8.0 to 0.8.1 --- {{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 e8636fb8f..2d76c011e 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.8.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.8.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django