From 87b6180142d90aca51748600aaf8415e0d331107 Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Thu, 30 May 2019 03:28:57 -0700 Subject: [PATCH 01/80] Use DatabaseScheduler for celery beat --- .../compose/local/django/celery/beat/start | 2 +- .../compose/production/django/celery/beat/start | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start index 389e2baf..f954960f 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 config.celery_app beat -l INFO +celery -A config.celery_app beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start index 0e793e38..a549c6b2 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 config.celery_app beat -l INFO +celery -A config.celery_app beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler From 915848e279fcbb64f7419018c5c571594fd867eb Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Thu, 30 May 2019 03:34:57 -0700 Subject: [PATCH 02/80] Add name to CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 7a9dbf79..6f6d4c32 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -191,6 +191,7 @@ Listed in alphabetical order. Will Farley `@goldhand`_ @g01dhand William Archinal `@archinal`_ Yaroslav Halchenko + Keyvan Mosharraf `@keyvanm`_ ========================== ============================ ============== .. _@a7p: https://github.com/a7p @@ -325,6 +326,7 @@ Listed in alphabetical order. .. _@vladdoster: https://github.com/vladdoster .. _@cmargieson: https://github.com/cmargieson .. _@tanoabeleyra: https://github.com/tanoabeleyra +.. _@keyvanm: https://github.com/keyvanm Special Thanks ~~~~~~~~~~~~~~ From 631bddc8114861cdafc2af56ff109b176599ea57 Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Thu, 30 May 2019 16:42:19 -0700 Subject: [PATCH 03/80] Set celery beat scheduler using settings + install django_celery_beat if use_celery --- .../compose/local/django/celery/beat/start | 2 +- .../compose/production/django/celery/beat/start | 2 +- {{cookiecutter.project_slug}}/config/settings/base.py | 5 +++++ {{cookiecutter.project_slug}}/requirements/base.txt | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start index f954960f..389e2baf 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 config.celery_app beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler +celery -A config.celery_app beat -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 a549c6b2..0e793e38 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 config.celery_app beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler +celery -A config.celery_app beat -l INFO diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 4a522fdd..5f489389 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -75,6 +75,9 @@ THIRD_PARTY_APPS = [ "allauth.account", "allauth.socialaccount", "rest_framework", +{% if cookiecutter.use_celery == 'y' -%} + "django_celery_beat", +{%- endif %} ] LOCAL_APPS = [ "{{ cookiecutter.project_slug }}.users.apps.UsersConfig", @@ -270,6 +273,8 @@ 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 CELERY_TASK_SOFT_TIME_LIMIT = 60 +# http://docs.celeryproject.org/en/latest/userguide/configuration.html#beat-scheduler +CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler" {%- endif %} # django-allauth diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index ddd8f041..2ec5fdf4 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,6 +11,7 @@ whitenoise==4.1.2 # https://github.com/evansd/whitenoise redis==3.2.1 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} celery==4.3.0 # pyup: < 5.0 # https://github.com/celery/celery +django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat {%- if cookiecutter.use_docker == 'y' %} flower==0.9.3 # https://github.com/mher/flower {%- endif %} From aee9f3ecfa8df143d2a5036098d1e701b15f4213 Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Thu, 30 May 2019 16:59:58 -0700 Subject: [PATCH 04/80] Install django_celery_beat in the proper way --- {{cookiecutter.project_slug}}/config/settings/base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 5f489389..94fd384f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -75,10 +75,12 @@ THIRD_PARTY_APPS = [ "allauth.account", "allauth.socialaccount", "rest_framework", -{% if cookiecutter.use_celery == 'y' -%} - "django_celery_beat", -{%- endif %} ] +# http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#using-custom-scheduler-classes +{% if cookiecutter.use_celery == 'y' -%} +THIRD_PARTY_APPS += ["django_celery_beat"] +{%- endif %} + LOCAL_APPS = [ "{{ cookiecutter.project_slug }}.users.apps.UsersConfig", # Your stuff: custom apps go here From e9e79428d3789622b31522ef0810147c6aa645be Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Fri, 31 May 2019 03:45:59 -0700 Subject: [PATCH 05/80] Better way to include django_celery_beat in INSTALLED_APPS --- {{cookiecutter.project_slug}}/config/settings/base.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 94fd384f..2745058d 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -75,11 +75,10 @@ THIRD_PARTY_APPS = [ "allauth.account", "allauth.socialaccount", "rest_framework", -] -# http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#using-custom-scheduler-classes -{% if cookiecutter.use_celery == 'y' -%} -THIRD_PARTY_APPS += ["django_celery_beat"] +{%- if cookiecutter.use_celery == 'y' %} + "django_celery_beat", {%- endif %} +] LOCAL_APPS = [ "{{ cookiecutter.project_slug }}.users.apps.UsersConfig", From 32e683f637510d5e416acf0efc5c0476271a108f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Jun 2019 13:45:32 -0700 Subject: [PATCH 06/80] Update pytest from 4.6.0 to 4.6.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d6049ecb..aa634c97 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ tox==3.12.1 -pytest==4.6.0 +pytest==4.6.2 pytest_cases==1.6.3 pytest-cookies==0.3.0 pytest-xdist==1.28.0 From 987e958c9b9d7067e890bb464e73cfc18d2cf433 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 4 Jun 2019 12:00:33 +0100 Subject: [PATCH 07/80] Update pytest from 4.6.0 to 4.6.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 c5cd6d9f..b29a6ea4 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.6.0 # https://github.com/pytest-dev/pytest +pytest==4.6.2 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 28ba260e0325a780be59d1e77c8f4bcf4ade752f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 4 Jun 2019 12:00:40 +0100 Subject: [PATCH 08/80] Update pytest-django from 3.4.8 to 3.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 c5cd6d9f..216e3f0d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -32,4 +32,4 @@ 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.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 +pytest-django==3.5.0 # https://github.com/pytest-dev/pytest-django From ef59ffad94298a13f19c99bbe8d7bd29e058fbcf Mon Sep 17 00:00:00 2001 From: "Xaver Y.R. Chen" Date: Wed, 5 Jun 2019 20:21:37 +0800 Subject: [PATCH 09/80] Update Travis config, using new xenial distribution to support the newer version of SQLite to satisfy the requirement of Django 2.2 --- CONTRIBUTORS.rst | 2 ++ {{cookiecutter.project_slug}}/.travis.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 6f6d4c32..af81c451 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -190,6 +190,7 @@ Listed in alphabetical order. Vlad Doster `@vladdoster`_ Will Farley `@goldhand`_ @g01dhand William Archinal `@archinal`_ + Xaver Y.R. Chen `@yrchen`_ @yrchen Yaroslav Halchenko Keyvan Mosharraf `@keyvanm`_ ========================== ============================ ============== @@ -327,6 +328,7 @@ Listed in alphabetical order. .. _@cmargieson: https://github.com/cmargieson .. _@tanoabeleyra: https://github.com/tanoabeleyra .. _@keyvanm: https://github.com/keyvanm +.. _@yrchen: https://github.com/yrchen Special Thanks ~~~~~~~~~~~~~~ diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 3072f75f..25705603 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -1,8 +1,9 @@ +dist: xenial sudo: true before_install: - sudo apt-get update -qq - sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb - - sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev + - sudo apt-get install -qq libjpeg8-dev libfreetype6-dev libwebp-dev - sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip - sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm From 2103cf2f9d5f60117ed5b47c7a166ee544015717 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 5 Jun 2019 19:00:43 +0100 Subject: [PATCH 10/80] Add a pre-generation hook to avoid non-lowercase slugs - fixes #2042 --- hooks/pre_gen_project.py | 4 ++++ tests/test_cookiecutter_generation.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index e7bc1e39..91332f14 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -22,6 +22,10 @@ if hasattr(project_slug, "isidentifier"): project_slug.isidentifier() ), "'{}' project slug is not a valid Python identifier.".format(project_slug) +assert ( + project_slug == project_slug.lower() +), "'{}' project slug should be all lowercase".format(project_slug) + assert ( "\\" not in "{{ cookiecutter.author_name }}" ), "Don't include backslashes in author name." diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 4292f989..77f71df5 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -2,6 +2,7 @@ import os import re import pytest +from cookiecutter.exceptions import FailedHookException from pytest_cases import pytest_fixture_plus import sh import yaml @@ -145,3 +146,14 @@ def test_travis_invokes_pytest(cookies, context): assert yaml.load(travis_yml)["script"] == ["pytest"] except yaml.YAMLError as e: pytest.fail(e) + + +@pytest.mark.parametrize("slug", ["project slug", "Project_Slug"]) +def test_invalid_slug(cookies, context, slug): + """Invalid slug should failed pre-generation hook.""" + context.update({"project_slug": slug}) + + result = cookies.bake(extra_context=context) + + assert result.exit_code != 0 + assert isinstance(result.exception, FailedHookException) From 611373cac24cae480a0ad5ded780d7db078497aa Mon Sep 17 00:00:00 2001 From: "Xaver Y.R. Chen" Date: Thu, 6 Jun 2019 14:48:48 +0800 Subject: [PATCH 11/80] Update Travis config, remove the deprecated sudo keyword --- {{cookiecutter.project_slug}}/.travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 25705603..83101d1d 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -1,5 +1,4 @@ dist: xenial -sudo: true before_install: - sudo apt-get update -qq - sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb From 6f9e57618d0e454dcd1ee2fb9281eb268b341304 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 6 Jun 2019 17:23:37 +0100 Subject: [PATCH 12/80] Add Postgres service to Travis config --- {{cookiecutter.project_slug}}/.travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 83101d1d..2d86ac31 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -1,4 +1,6 @@ dist: xenial +services: + - postgresql before_install: - sudo apt-get update -qq - sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb From 59fcf9359b34f327c483e6fcb3077491abce74a5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 7 Jun 2019 00:19:38 -0700 Subject: [PATCH 13/80] Update pyyaml from 5.1 to 5.1.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index aa634c97..e14a4565 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,4 @@ pytest==4.6.2 pytest_cases==1.6.3 pytest-cookies==0.3.0 pytest-xdist==1.28.0 -pyyaml==5.1 +pyyaml==5.1.1 From d55a3f09aa4a64a065d2a437728425669a91fcaf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 11 Jun 2019 12:00:31 +0100 Subject: [PATCH 14/80] Update sphinx from 2.1.0 to 2.1.1 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 0e686786..0df75780 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb -Sphinx==2.1.0 # https://github.com/sphinx-doc/sphinx +Sphinx==2.1.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From 06a9cadf0cf238115bb1097d7ce6dd7e2a01d34f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 11 Jun 2019 12:00:34 +0100 Subject: [PATCH 15/80] Update django-extensions from 2.1.7 to 2.1.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 0e686786..56e48223 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.7 # https://github.com/django-extensions/django-extensions +django-extensions==2.1.9 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.5.0 # https://github.com/pytest-dev/pytest-django From 44688b2d43c2af968286d51751d3bb6c28496a39 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 12 Jun 2019 12:00:29 +0100 Subject: [PATCH 16/80] Update pytest from 4.6.2 to 4.6.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e14a4565..5555c34c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ tox==3.12.1 -pytest==4.6.2 +pytest==4.6.3 pytest_cases==1.6.3 pytest-cookies==0.3.0 pytest-xdist==1.28.0 From 0b5f8b4891c082d4e29ae7724571ae95692e2295 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 12 Jun 2019 12:00:30 +0100 Subject: [PATCH 17/80] Update pytest from 4.6.2 to 4.6.3 --- {{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 7a2ca885..2e4f9ab1 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.6.2 # https://github.com/pytest-dev/pytest +pytest==4.6.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 9e10eb7ae50abd7545064fec6a77431f2f05ca5a Mon Sep 17 00:00:00 2001 From: Jelmert Date: Thu, 6 Jun 2019 11:45:43 +0200 Subject: [PATCH 18/80] Added DATABASE_URL & CELERY_BROKER_URL (when selected) to the django console startup script of pycharm. Fixes #1766. --- {{cookiecutter.project_slug}}/.idea/workspace.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/.idea/workspace.xml diff --git a/{{cookiecutter.project_slug}}/.idea/workspace.xml b/{{cookiecutter.project_slug}}/.idea/workspace.xml new file mode 100644 index 00000000..a5d73c18 --- /dev/null +++ b/{{cookiecutter.project_slug}}/.idea/workspace.xml @@ -0,0 +1,14 @@ + + + {%- if cookiecutter.use_celery == 'y' %} + + + {%- else %} + + + {%- endif %} + From 94d0b7b776ba08bf79e2b089373f70e15dc9933a Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 14 Jun 2019 12:00:30 +0100 Subject: [PATCH 19/80] Update pytest_cases from 1.6.3 to 1.7.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5555c34c..fcdca838 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.7 # ------------------------------------------------------------------------------ tox==3.12.1 pytest==4.6.3 -pytest_cases==1.6.3 +pytest_cases==1.7.0 pytest-cookies==0.3.0 pytest-xdist==1.28.0 pyyaml==5.1.1 From de91817704ade2057cd2b9550ca733eefc183cde Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 14 Jun 2019 12:00:33 +0100 Subject: [PATCH 20/80] Update psycopg2-binary from 2.8.2 to 2.8.3 --- {{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 2e4f9ab1..d28774d4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -6,7 +6,7 @@ Sphinx==2.1.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} -psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2 +psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 {%- endif %} # Testing From 36bccb0e28e0a6e2b0a48b8a705f0c92dd011a31 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 14 Jun 2019 12:49:02 +0100 Subject: [PATCH 21/80] Update psycopg2 with --no-binary to 2.8.3 --- {{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 d28774d4..46b602e6 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.1.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} -psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 {%- endif %} From 12b527ff5d39db2c5db8c5cb8798ad601395f487 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 14 Jun 2019 12:49:39 +0100 Subject: [PATCH 22/80] Update psycopg2 with --no-binary to 2.8.3 in prod requirements --- {{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 8cf1f1c4..39998f7a 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.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} From 62df724c8c1586af9ac7bebf459821af67f801b3 Mon Sep 17 00:00:00 2001 From: Min ho Kim Date: Sat, 15 Jun 2019 06:37:58 +1000 Subject: [PATCH 23/80] Fix typo --- docs/deployment-on-heroku.rst | 16 ++++++++-------- docs/deployment-on-pythonanywhere.rst | 4 ++-- docs/testing.rst | 8 ++++---- .../docs/pycharm/configuration.rst | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst index 4a16123a..53e98037 100644 --- a/docs/deployment-on-heroku.rst +++ b/docs/deployment-on-heroku.rst @@ -23,25 +23,25 @@ Run these commands to deploy the project to Heroku: heroku addons:create mailgun:starter heroku config:set PYTHONHASHSEED=random - + heroku config:set WEB_CONCURRENCY=4 - + heroku config:set DJANGO_DEBUG=False heroku config:set DJANGO_SETTINGS_MODULE=config.settings.production heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)" - - # Generating a 32 character-long random string without any of the visually similiar characters "IOl01": + + # Generating a 32 character-long random string without any of the visually similar characters "IOl01": heroku config:set DJANGO_ADMIN_URL="$(openssl rand -base64 4096 | tr -dc 'A-HJ-NP-Za-km-z2-9' | head -c 32)/" - + # Set this to your Heroku app url, e.g. 'bionic-beaver-28392.herokuapp.com' heroku config:set DJANGO_ALLOWED_HOSTS= - + # Assign with AWS_ACCESS_KEY_ID heroku config:set DJANGO_AWS_ACCESS_KEY_ID= - + # Assign with AWS_SECRET_ACCESS_KEY heroku config:set DJANGO_AWS_SECRET_ACCESS_KEY= - + # Assign with AWS_STORAGE_BUCKET_NAME heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME= diff --git a/docs/deployment-on-pythonanywhere.rst b/docs/deployment-on-pythonanywhere.rst index ea25b3ae..83b23b27 100644 --- a/docs/deployment-on-pythonanywhere.rst +++ b/docs/deployment-on-pythonanywhere.rst @@ -29,7 +29,7 @@ Once you've been through this one-off config, future deployments are much simple Getting your code and dependencies installed on PythonAnywhere -------------------------------------------------------------- -Make sure your project is fully commited and pushed up to Bitbucket or Github or wherever it may be. Then, log into your PythonAnywhere account, open up a **Bash** console, clone your repo, and create a virtualenv: +Make sure your project is fully committed and pushed up to Bitbucket or Github or wherever it may be. Then, log into your PythonAnywhere account, open up a **Bash** console, clone your repo, and create a virtualenv: .. code-block:: bash @@ -153,7 +153,7 @@ Back on the Web tab, hit **Reload**, and your app should be live! **NOTE:** *you may see security warnings until you set up your SSL certificates. If you -want to supress them temporarily, set DJANGO_SECURE_SSL_REDIRECT to blank. Follow +want to suppress them temporarily, set DJANGO_SECURE_SSL_REDIRECT to blank. Follow the instructions here to get SSL set up: https://help.pythonanywhere.com/pages/SSLOwnDomains/* diff --git a/docs/testing.rst b/docs/testing.rst index 6ca21388..63cb9e18 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -19,9 +19,9 @@ You will get a readout of the `users` app that has already been set up with test If you set up your project to `develop locally with docker`_, run the following command: :: - $ docker-compose -f local.yml run django pytest + $ docker-compose -f local.yml run django pytest -Targetting particular apps for testing in ``docker`` follows a similar pattern as previously shown above. +Targeting particular apps for testing in ``docker`` follows a similar pattern as previously shown above. Coverage -------- @@ -36,9 +36,9 @@ Once the tests are complete, in order to see the code coverage, run the followin .. note:: - At the root of the project folder, you will find the `pytest.ini` file. You can use this to customize_ the ``pytest`` to your liking. + At the root of the project folder, you will find the `pytest.ini` file. You can use this to customize_ the ``pytest`` to your liking. - There is also the `.coveragerc`. This is the configuration file for the ``coverage`` tool. You can find out more about `configuring`_ ``coverage``. + There is also the `.coveragerc`. This is the configuration file for the ``coverage`` tool. You can find out more about `configuring`_ ``coverage``. .. seealso:: diff --git a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst index af3b826a..c1d4f4b9 100644 --- a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst +++ b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst @@ -14,7 +14,7 @@ This repository comes with already prepared "Run/Debug Configurations" for docke .. image:: images/2.png -But as you can see, at the beggining there is something wrong with them. They have red X on django icon, and they cannot be used, without configuring remote python interpteter. To do that, you have to go to *Settings > Build, Execution, Deployment* first. +But as you can see, at the beginning there is something wrong with them. They have red X on django icon, and they cannot be used, without configuring remote python interpteter. To do that, you have to go to *Settings > Build, Execution, Deployment* first. Next, you have to add new remote python interpreter, based on already tested deployment settings. Go to *Settings > Project > Project Interpreter*. Click on the cog icon, and click *Add Remote*. From 53a6349e9223f1bc95737c9c95caf2df94bf0828 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 14 Jun 2019 14:16:20 -0700 Subject: [PATCH 24/80] Update pytest-xdist from 1.28.0 to 1.29.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5555c34c..32062000 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,5 @@ tox==3.12.1 pytest==4.6.3 pytest_cases==1.6.3 pytest-cookies==0.3.0 -pytest-xdist==1.28.0 +pytest-xdist==1.29.0 pyyaml==5.1.1 From 69fa49036461c4717bcb88dd7c226a91619e4d12 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 14 Jun 2019 23:18:20 +0100 Subject: [PATCH 25/80] Add minho42 to contributors --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index af81c451..e34def45 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -152,6 +152,7 @@ Listed in alphabetical order. Meghan Heintz `@dot2dotseurat`_ Mesut Yılmaz `@myilmaz`_ Michael Gecht `@mimischi`_ @_mischi + Min ho Kim `@minho42`_ mozillazg `@mozillazg`_ Oleg Russkin `@rolep`_ Pablo `@oubiga`_ @@ -270,6 +271,7 @@ Listed in alphabetical order. .. _@mostaszewski: https://github.com/mostaszewski .. _@mfwarren: https://github.com/mfwarren .. _@mimischi: https://github.com/mimischi +.. _@minho42: https://github.com/minho42 .. _@mjsisley: https://github.com/mjsisley .. _@myilmaz: https://github.com/myilmaz .. _@mozillazg: https://github.com/mozillazg From f3b85708c365ab897a738308d31bc1c9af15ced0 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 15 Jun 2019 11:31:13 +0100 Subject: [PATCH 26/80] Sort contributors list --- CONTRIBUTORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index e34def45..275b707f 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -130,6 +130,7 @@ Listed in alphabetical order. Keith Webber `@townie`_ Kevin A. Stone Kevin Ndung'u `@kevgathuku`_ + Keyvan Mosharraf `@keyvanm`_ Krzysztof Szumny `@noisy`_ Krzysztof Żuraw `@krzysztofzuraw`_ Leonardo Jimenez `@xpostudio4`_ @@ -193,7 +194,6 @@ Listed in alphabetical order. William Archinal `@archinal`_ Xaver Y.R. Chen `@yrchen`_ @yrchen Yaroslav Halchenko - Keyvan Mosharraf `@keyvanm`_ ========================== ============================ ============== .. _@a7p: https://github.com/a7p From a321a5833da8a80bb0d3434ef8fd3dfaafaca280 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 15 Jun 2019 11:48:26 +0100 Subject: [PATCH 27/80] Cleanup trailing spaces --- .../.idea/{{cookiecutter.project_slug}}.iml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml b/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml index 8ff6e388..079c7b4e 100644 --- a/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml +++ b/{{cookiecutter.project_slug}}/.idea/{{cookiecutter.project_slug}}.iml @@ -5,10 +5,10 @@ @@ -25,12 +25,12 @@ - - - -