From 03772dec1b40bd0a970f58528c4b920b76f7cc9e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 Nov 2016 14:49:39 -0800 Subject: [PATCH 001/507] Update flake8 from 3.2.0 to 3.2.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1052e217..369520cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ cookiecutter==1.4.0 -flake8==3.2.0 # pyup: != 2.6.0 +flake8==3.2.1 # pyup: != 2.6.0 sh==1.11 binaryornot==0.4.0 From 0c203241669277411df4bccf9d4bc9708c77affb Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 21 Nov 2016 14:49:40 -0800 Subject: [PATCH 002/507] Update flake8 from 3.2.0 to 3.2.1 --- {{cookiecutter.project_slug}}/requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/test.txt b/{{cookiecutter.project_slug}}/requirements/test.txt index 2dc42bd4..704a508c 100644 --- a/{{cookiecutter.project_slug}}/requirements/test.txt +++ b/{{cookiecutter.project_slug}}/requirements/test.txt @@ -8,7 +8,7 @@ psycopg2==2.6.2 {%- endif %} coverage==4.2 -flake8==3.2.0 # pyup: != 2.6.0 +flake8==3.2.1 # pyup: != 2.6.0 django-test-plus==1.0.16 factory_boy==2.7.0 From 6213af4b562f640362c95f9c8386cec597e8600d Mon Sep 17 00:00:00 2001 From: Oleg Russkin Date: Tue, 12 Mar 2019 16:35:03 +0200 Subject: [PATCH 003/507] Update redis to 3.2.0 Related bug was fixed: celery/kombu#947 Moreover, recent kombu versiones demand such redis version. --- {{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 e43b70af..0a9144ec 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.2 # https://github.com/evansd/whitenoise {%- endif %} -redis>=2.10.6, < 3 # pyup: < 3 # https://github.com/antirez/redis +redis>=3.2.0 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} celery==4.2.1 # pyup: < 5.0 # https://github.com/celery/celery {%- if cookiecutter.use_docker == 'y' %} From 638c93d1dff45849b531e2633d0369f7ac130567 Mon Sep 17 00:00:00 2001 From: Oleg Russkin Date: Tue, 12 Mar 2019 16:38:43 +0200 Subject: [PATCH 004/507] Add kombu to base (celery) dependencies Using latest version 4.4.0, previous suitable 4.3.0 also had bug: kombu/issues#1006 --- {{cookiecutter.project_slug}}/requirements/base.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 0a9144ec..605ff19c 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.0 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} celery==4.2.1 # pyup: < 5.0 # https://github.com/celery/celery +kombu==4.4.0 # https://github.com/celery/kombu {%- if cookiecutter.use_docker == 'y' %} flower==0.9.2 # https://github.com/mher/flower {%- endif %} From 8ab63940ec9b151f03f99f6aff3e84eae973b47b Mon Sep 17 00:00:00 2001 From: Oleg Russkin Date: Tue, 12 Mar 2019 16:49:24 +0200 Subject: [PATCH 005/507] Contributors: Add Oleg Russkin --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index dc41463f..2a26e212 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -145,6 +145,7 @@ Listed in alphabetical order. Mesut Yılmaz `@myilmaz`_ Michael Gecht `@mimischi`_ @_mischi mozillazg `@mozillazg`_ + Oleg Russkin `@rolep`_ Pablo `@oubiga`_ Parbhat Puri `@parbhat`_ Peter Bittner `@bittner`_ From 02c19193a0a54800dfaaea75c39d52f23a5a12d8 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 18 Mar 2019 09:54:39 +0000 Subject: [PATCH 006/507] Specify requirements file in Pyup config --- .pyup.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .pyup.yml diff --git a/.pyup.yml b/.pyup.yml new file mode 100644 index 00000000..4eab42d5 --- /dev/null +++ b/.pyup.yml @@ -0,0 +1,6 @@ +# Specify requirement files by hand +requirements: + - requirements.txt + - {{cookiecutter.project_slug}}/requirements/base.txt + - {{cookiecutter.project_slug}}/requirements/local.txt + - {{cookiecutter.project_slug}}/requirements/production.txt From a4a7c6488f79bba6c2c556ab6dbfee4f7e242655 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 18 Mar 2019 09:56:20 +0000 Subject: [PATCH 007/507] Fix syntax in PyUP config file --- .pyup.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.pyup.yml b/.pyup.yml index 4eab42d5..b368b664 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -1,6 +1,18 @@ # Specify requirement files by hand requirements: - - requirements.txt - - {{cookiecutter.project_slug}}/requirements/base.txt - - {{cookiecutter.project_slug}}/requirements/local.txt - - {{cookiecutter.project_slug}}/requirements/production.txt + - requirements.txt: + # update all dependencies and pin them + update: all + pin: True + - {{cookiecutter.project_slug}}/requirements/base.txt: + # update all dependencies and pin them + update: all + pin: True + - {{cookiecutter.project_slug}}/requirements/local.txt: + # update all dependencies and pin them + update: all + pin: True + - {{cookiecutter.project_slug}}/requirements/production.txt: + # update all dependencies and pin them + update: all + pin: True From 135c6d7f595a7828201987657f16f8c6fc798ba4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 18 Mar 2019 09:59:13 +0000 Subject: [PATCH 008/507] Fix syntax error in PyUP config - take 2 --- .pyup.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.pyup.yml b/.pyup.yml index b368b664..9f78cf8c 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -1,18 +1,6 @@ # Specify requirement files by hand requirements: - - requirements.txt: - # update all dependencies and pin them - update: all - pin: True - - {{cookiecutter.project_slug}}/requirements/base.txt: - # update all dependencies and pin them - update: all - pin: True - - {{cookiecutter.project_slug}}/requirements/local.txt: - # update all dependencies and pin them - update: all - pin: True - - {{cookiecutter.project_slug}}/requirements/production.txt: - # update all dependencies and pin them - update: all - pin: True + - "requirements.txt" + - "{{cookiecutter.project_slug}}/requirements/base.txt" + - "{{cookiecutter.project_slug}}/requirements/local.txt" + - "{{cookiecutter.project_slug}}/requirements/production.txt" From 43a6f5d854d1cc8ef2afb3d78067fcb8d08a76c7 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 18 Mar 2019 10:03:32 +0000 Subject: [PATCH 009/507] Update .pyup.yml --- .pyup.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.pyup.yml b/.pyup.yml index 9f78cf8c..4978524e 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -1,4 +1,15 @@ -# Specify requirement files by hand +# configure updates globally +# default: all +# allowed: all, insecure, False +update: all + +# configure dependency pinning globally +# default: True +# allowed: True, False +pin: True + +# Specify requirement files by hand, pyup seems to struggle to +# find the ones in the project_slug folder requirements: - "requirements.txt" - "{{cookiecutter.project_slug}}/requirements/base.txt" From 68f7268770057752609dd1f6beca4d432eb9f2a5 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 18 Mar 2019 17:49:43 +0000 Subject: [PATCH 010/507] Run Black on Travis (#1957) * Create a test matrix on Travis CI to help testing multiple options * Change test_docker.sh to fail if any command in it fails * Run black on the CI with --check option * Fix formatting of project files using black * Install black in the docker container * Exclude migrations in black checks * Fix Black formatting violations * Run black on the whole generated project & fix issues --- .travis.yml | 16 +- hooks/post_gen_project.py | 54 ++-- hooks/pre_gen_project.py | 10 +- tests/test_cookiecutter_generation.py | 4 +- tests/test_docker.sh | 7 +- tox.ini | 6 +- .../config/settings/base.py | 206 +++++++-------- .../config/settings/local.py | 48 ++-- .../config/settings/production.py | 249 +++++++++--------- .../config/settings/test.py | 8 +- {{cookiecutter.project_slug}}/config/urls.py | 13 +- {{cookiecutter.project_slug}}/config/wsgi.py | 11 +- .../requirements/local.txt | 1 + .../taskapp/celery.py | 18 +- .../users/adapters.py | 2 - .../users/forms.py | 1 - .../users/tests/factories.py | 4 +- .../users/tests/test_forms.py | 1 - .../users/tests/test_views.py | 1 - 19 files changed, 328 insertions(+), 332 deletions(-) diff --git a/.travis.yml b/.travis.yml index a46726d6..65b2a28d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,16 +7,20 @@ language: python python: 3.6 -env: - - TOX_ENV=py36 - before_install: - docker-compose -v - docker -v -script: - - tox -e $TOX_ENV - - sh tests/test_docker.sh +matrix: + include: + - name: Test + script: tox -e py36 + - name: Black + script: tox -e black + - name: Basic Docker + script: sh tests/test_docker.sh + - name: Docker with Celery + script: sh tests/test_docker.sh use_celery=y install: - pip install tox diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 45435dd0..a9c1c941 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -32,10 +32,7 @@ DEBUG_VALUE = "debug" def remove_open_source_files(): - file_names = [ - "CONTRIBUTORS.txt", - "LICENSE", - ] + file_names = ["CONTRIBUTORS.txt", "LICENSE"] for file_name in file_names: os.remove(file_name) @@ -71,7 +68,10 @@ def remove_utility_files(): def remove_heroku_files(): file_names = ["Procfile", "runtime.txt", "requirements.txt"] for file_name in file_names: - if file_name == "requirements.txt" and "{{ cookiecutter.use_travisci }}".lower() == "y": + if ( + file_name == "requirements.txt" + and "{{ cookiecutter.use_travisci }}".lower() == "y" + ): # don't remove the file if we are using travisci but not using heroku continue os.remove(file_name) @@ -183,11 +183,7 @@ def generate_postgres_user(debug=False): def set_postgres_user(file_path, value): - postgres_user = set_flag( - file_path, - "!!!SET POSTGRES_USER!!!", - value=value, - ) + postgres_user = set_flag(file_path, "!!!SET POSTGRES_USER!!!", value=value) return postgres_user @@ -205,9 +201,7 @@ def set_postgres_password(file_path, value=None): def set_celery_flower_user(file_path, value): celery_flower_user = set_flag( - file_path, - "!!!SET CELERY_FLOWER_USER!!!", - value=value, + file_path, "!!!SET CELERY_FLOWER_USER!!!", value=value ) return celery_flower_user @@ -230,11 +224,7 @@ def append_to_gitignore_file(s): gitignore_file.write(os.linesep) -def set_flags_in_envs( - postgres_user, - celery_flower_user, - debug=False, -): +def set_flags_in_envs(postgres_user, celery_flower_user, debug=False): local_django_envs_path = os.path.join(".envs", ".local", ".django") production_django_envs_path = os.path.join(".envs", ".production", ".django") local_postgres_envs_path = os.path.join(".envs", ".local", ".postgres") @@ -244,14 +234,22 @@ def set_flags_in_envs( set_django_admin_url(production_django_envs_path) set_postgres_user(local_postgres_envs_path, value=postgres_user) - set_postgres_password(local_postgres_envs_path, value=DEBUG_VALUE if debug else None) + set_postgres_password( + local_postgres_envs_path, value=DEBUG_VALUE if debug else None + ) set_postgres_user(production_postgres_envs_path, value=postgres_user) - set_postgres_password(production_postgres_envs_path, value=DEBUG_VALUE if debug else None) + set_postgres_password( + production_postgres_envs_path, value=DEBUG_VALUE if debug else None + ) set_celery_flower_user(local_django_envs_path, value=celery_flower_user) - set_celery_flower_password(local_django_envs_path, value=DEBUG_VALUE if debug else None) + set_celery_flower_password( + local_django_envs_path, value=DEBUG_VALUE if debug else None + ) set_celery_flower_user(production_django_envs_path, value=celery_flower_user) - set_celery_flower_password(production_django_envs_path, value=DEBUG_VALUE if debug else None) + set_celery_flower_password( + production_django_envs_path, value=DEBUG_VALUE if debug else None + ) def set_flags_in_settings_files(): @@ -302,8 +300,8 @@ def main(): if "{{ cookiecutter.keep_local_envs_in_vcs }}".lower() == "y": print( INFO + ".env(s) are only utilized when Docker Compose and/or " - "Heroku support is enabled so keeping them does not " - "make sense given your current setup." + TERMINATOR + "Heroku support is enabled so keeping them does not " + "make sense given your current setup." + TERMINATOR ) remove_envs_and_associated_files() else: @@ -325,10 +323,10 @@ def main(): "{{ cookiecutter.js_task_runner }}".lower().capitalize() ) + "working together not supported yet. " - "You can continue using the generated project like you " - "normally would, however you would need to add a JS " - "task runner service to your Docker Compose configuration " - "manually." + TERMINATOR + "You can continue using the generated project like you " + "normally would, however you would need to add a JS " + "task runner service to your Docker Compose configuration " + "manually." + TERMINATOR ) if "{{ cookiecutter.use_celery }}".lower() == "n": diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index b7f4dfbb..a6b83455 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -18,11 +18,13 @@ SUCCESS = "\x1b[1;32m [SUCCESS]: " project_slug = "{{ cookiecutter.project_slug }}" if hasattr(project_slug, "isidentifier"): - assert project_slug.isidentifier(), "'{}' project slug is not a valid Python identifier.".format( - project_slug - ) + assert ( + project_slug.isidentifier() + ), "'{}' project slug is not a valid Python identifier.".format(project_slug) -assert "\\" not in "{{ cookiecutter.author_name }}", "Don't include backslashes in author name." +assert ( + "\\" not in "{{ cookiecutter.author_name }}" +), "Don't include backslashes in author name." if "{{ cookiecutter.use_docker }}".lower() == "n": python_major_version = sys.version_info[0] diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index b2c235a8..3010d364 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -97,8 +97,8 @@ def test_travis_invokes_pytest(cookies, context): assert result.project.basename == context["project_slug"] assert result.project.isdir() - with open(f'{result.project}/.travis.yml', 'r') as travis_yml: + with open(f"{result.project}/.travis.yml", "r") as travis_yml: try: - assert yaml.load(travis_yml)['script'] == ['pytest'] + assert yaml.load(travis_yml)["script"] == ["pytest"] except yaml.YAMLError as e: pytest.fail(e) diff --git a/tests/test_docker.sh b/tests/test_docker.sh index eddfe98c..55771c14 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -3,6 +3,8 @@ # it is meant to be run from the root directory of the repository, eg: # sh tests/test_docker.sh +set -o errexit + # install test requirements pip install -r requirements.txt @@ -11,12 +13,15 @@ mkdir -p .cache/docker cd .cache/docker # create the project using the default settings in cookiecutter.json -cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y +cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y $@ cd my_awesome_project # run the project's type checks docker-compose -f local.yml run django mypy my_awesome_project +# Run black with --check option +docker-compose -f local.yml run django black --check --diff --exclude 'migrations' ./ + # run the project's tests docker-compose -f local.yml run django pytest diff --git a/tox.ini b/tox.ini index 040c8a41..cef3efc7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,11 @@ [tox] skipsdist = true -envlist = py36 +envlist = py36,black [testenv] deps = -rrequirements.txt commands = pytest {posargs:./tests} + +[testenv:black] +deps = black +commands = black --check hooks tests setup.py docs diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 950b9ed7..848af8e8 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -4,27 +4,29 @@ Base settings to build other settings files upon. import environ -ROOT_DIR = environ.Path(__file__) - 3 # ({{ cookiecutter.project_slug }}/config/settings/base.py - 3 = {{ cookiecutter.project_slug }}/) -APPS_DIR = ROOT_DIR.path('{{ cookiecutter.project_slug }}') +ROOT_DIR = ( + environ.Path(__file__) - 3 +) # ({{ cookiecutter.project_slug }}/config/settings/base.py - 3 = {{ cookiecutter.project_slug }}/) +APPS_DIR = ROOT_DIR.path("{{ cookiecutter.project_slug }}") env = environ.Env() -READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False) +READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False) if READ_DOT_ENV_FILE: # OS environment variables take precedence over variables from .env - env.read_env(str(ROOT_DIR.path('.env'))) + env.read_env(str(ROOT_DIR.path(".env"))) # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#debug -DEBUG = env.bool('DJANGO_DEBUG', False) +DEBUG = env.bool("DJANGO_DEBUG", False) # Local time zone. Choices are # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # though not all of them may be available with every OS. # In Windows, this must be set to your system time zone. -TIME_ZONE = '{{ cookiecutter.timezone }}' +TIME_ZONE = "{{ cookiecutter.timezone }}" # https://docs.djangoproject.com/en/dev/ref/settings/#language-code -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = "en-us" # https://docs.djangoproject.com/en/dev/ref/settings/#site-id SITE_ID = 1 # https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n @@ -37,45 +39,45 @@ USE_TZ = True # DATABASES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#databases -{% if cookiecutter.use_docker == 'y' -%} -DATABASES = { - 'default': env.db('DATABASE_URL'), -} +{% if cookiecutter.use_docker == "y" -%} +DATABASES = {"default": env.db("DATABASE_URL")} {%- else %} DATABASES = { - 'default': env.db('DATABASE_URL', default='postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}'), + "default": env.db( + "DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}" + ), } {%- endif %} -DATABASES['default']['ATOMIC_REQUESTS'] = True +DATABASES["default"]["ATOMIC_REQUESTS"] = True # URLS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#root-urlconf -ROOT_URLCONF = 'config.urls' +ROOT_URLCONF = "config.urls" # https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application -WSGI_APPLICATION = 'config.wsgi.application' +WSGI_APPLICATION = "config.wsgi.application" # APPS # ------------------------------------------------------------------------------ DJANGO_APPS = [ - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.messages', - 'django.contrib.staticfiles', - # 'django.contrib.humanize', # Handy template tags - 'django.contrib.admin', + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.sites", + "django.contrib.messages", + "django.contrib.staticfiles", + # "django.contrib.humanize", # Handy template tags + "django.contrib.admin", ] THIRD_PARTY_APPS = [ - 'crispy_forms', - 'allauth', - 'allauth.account', - 'allauth.socialaccount', - 'rest_framework', + "crispy_forms", + "allauth", + "allauth.account", + "allauth.socialaccount", + "rest_framework", ] LOCAL_APPS = [ - '{{ cookiecutter.project_slug }}.users.apps.UsersAppConfig', + "{{ cookiecutter.project_slug }}.users.apps.UsersAppConfig", # Your stuff: custom apps go here ] # https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps @@ -84,86 +86,76 @@ INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS # MIGRATIONS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules -MIGRATION_MODULES = { - 'sites': '{{ cookiecutter.project_slug }}.contrib.sites.migrations' -} +MIGRATION_MODULES = {"sites": "{{ cookiecutter.project_slug }}.contrib.sites.migrations"} # AUTHENTICATION # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#authentication-backends AUTHENTICATION_BACKENDS = [ - 'django.contrib.auth.backends.ModelBackend', - 'allauth.account.auth_backends.AuthenticationBackend', + "django.contrib.auth.backends.ModelBackend", + "allauth.account.auth_backends.AuthenticationBackend", ] # https://docs.djangoproject.com/en/dev/ref/settings/#auth-user-model -AUTH_USER_MODEL = 'users.User' +AUTH_USER_MODEL = "users.User" # https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url -LOGIN_REDIRECT_URL = 'users:redirect' +LOGIN_REDIRECT_URL = "users:redirect" # https://docs.djangoproject.com/en/dev/ref/settings/#login-url -LOGIN_URL = 'account_login' +LOGIN_URL = "account_login" # PASSWORDS # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#password-hashers PASSWORD_HASHERS = [ # https://docs.djangoproject.com/en/dev/topics/auth/passwords/#using-argon2-with-django - 'django.contrib.auth.hashers.Argon2PasswordHasher', - 'django.contrib.auth.hashers.PBKDF2PasswordHasher', - 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', - 'django.contrib.auth.hashers.BCryptSHA256PasswordHasher', - 'django.contrib.auth.hashers.BCryptPasswordHasher', + "django.contrib.auth.hashers.Argon2PasswordHasher", + "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 = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator" }, + {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, + {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, + {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, ] # MIDDLEWARE # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#middleware MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", ] # STATIC # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#static-root -STATIC_ROOT = str(ROOT_DIR('staticfiles')) +STATIC_ROOT = str(ROOT_DIR("staticfiles")) # https://docs.djangoproject.com/en/dev/ref/settings/#static-url -STATIC_URL = '/static/' +STATIC_URL = "/static/" # https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS -STATICFILES_DIRS = [ - str(APPS_DIR.path('static')), -] +STATICFILES_DIRS = [str(APPS_DIR.path("static"))] # https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders STATICFILES_FINDERS = [ - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + "django.contrib.staticfiles.finders.FileSystemFinder", + "django.contrib.staticfiles.finders.AppDirectoriesFinder", ] # MEDIA # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#media-root -MEDIA_ROOT = str(APPS_DIR('media')) +MEDIA_ROOT = str(APPS_DIR("media")) # https://docs.djangoproject.com/en/dev/ref/settings/#media-url -MEDIA_URL = '/media/' +MEDIA_URL = "/media/" # TEMPLATES # ------------------------------------------------------------------------------ @@ -171,43 +163,39 @@ MEDIA_URL = '/media/' TEMPLATES = [ { # https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND - 'BACKEND': 'django.template.backends.django.DjangoTemplates', + "BACKEND": "django.template.backends.django.DjangoTemplates", # https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs - 'DIRS': [ - str(APPS_DIR.path('templates')), - ], - 'OPTIONS': { + "DIRS": [str(APPS_DIR.path("templates"))], + "OPTIONS": { # https://docs.djangoproject.com/en/dev/ref/settings/#template-debug - 'debug': DEBUG, + "debug": DEBUG, # https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders # https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types - 'loaders': [ - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', + "loaders": [ + "django.template.loaders.filesystem.Loader", + "django.template.loaders.app_directories.Loader", ], # https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.template.context_processors.i18n', - 'django.template.context_processors.media', - 'django.template.context_processors.static', - 'django.template.context_processors.tz', - 'django.contrib.messages.context_processors.messages', + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.tz", + "django.contrib.messages.context_processors.messages", ], }, - }, + } ] # http://django-crispy-forms.readthedocs.io/en/latest/install.html#template-packs -CRISPY_TEMPLATE_PACK = 'bootstrap4' +CRISPY_TEMPLATE_PACK = "bootstrap4" # FIXTURES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#fixture-dirs -FIXTURE_DIRS = ( - str(APPS_DIR.path('fixtures')), -) +FIXTURE_DIRS = (str(APPS_DIR.path("fixtures")),) # SECURITY # ------------------------------------------------------------------------------ @@ -218,41 +206,41 @@ CSRF_COOKIE_HTTPONLY = True # https://docs.djangoproject.com/en/dev/ref/settings/#secure-browser-xss-filter SECURE_BROWSER_XSS_FILTER = True # https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options -X_FRAME_OPTIONS = 'DENY' +X_FRAME_OPTIONS = "DENY" # EMAIL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend -EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend') +EMAIL_BACKEND = env( + "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.smtp.EmailBackend" +) # ADMIN # ------------------------------------------------------------------------------ # Django Admin URL. -ADMIN_URL = 'admin/' +ADMIN_URL = "admin/" # https://docs.djangoproject.com/en/dev/ref/settings/#admins -ADMINS = [ - ("""{{cookiecutter.author_name}}""", '{{cookiecutter.email}}'), -] +ADMINS = [("""{{cookiecutter.author_name}}""", "{{cookiecutter.email}}")] # https://docs.djangoproject.com/en/dev/ref/settings/#managers MANAGERS = ADMINS {% if cookiecutter.use_celery == 'y' -%} # Celery # ------------------------------------------------------------------------------ -INSTALLED_APPS += ['{{cookiecutter.project_slug}}.taskapp.celery.CeleryAppConfig'] +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 # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-broker_url -CELERY_BROKER_URL = env('CELERY_BROKER_URL') +CELERY_BROKER_URL = env("CELERY_BROKER_URL") # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_backend CELERY_RESULT_BACKEND = CELERY_BROKER_URL # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-accept_content -CELERY_ACCEPT_CONTENT = ['json'] +CELERY_ACCEPT_CONTENT = ["json"] # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-task_serializer -CELERY_TASK_SERIALIZER = 'json' +CELERY_TASK_SERIALIZER = "json" # http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-result_serializer -CELERY_RESULT_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 @@ -263,24 +251,24 @@ CELERYD_TASK_SOFT_TIME_LIMIT = 60 {%- endif %} # django-allauth # ------------------------------------------------------------------------------ -ACCOUNT_ALLOW_REGISTRATION = env.bool('DJANGO_ACCOUNT_ALLOW_REGISTRATION', True) +ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) # https://django-allauth.readthedocs.io/en/latest/configuration.html -ACCOUNT_AUTHENTICATION_METHOD = 'username' +ACCOUNT_AUTHENTICATION_METHOD = "username" # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_REQUIRED = True # https://django-allauth.readthedocs.io/en/latest/configuration.html -ACCOUNT_EMAIL_VERIFICATION = 'mandatory' +ACCOUNT_EMAIL_VERIFICATION = "mandatory" # https://django-allauth.readthedocs.io/en/latest/configuration.html -ACCOUNT_ADAPTER = '{{cookiecutter.project_slug}}.users.adapters.AccountAdapter' +ACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.AccountAdapter" # https://django-allauth.readthedocs.io/en/latest/configuration.html -SOCIALACCOUNT_ADAPTER = '{{cookiecutter.project_slug}}.users.adapters.SocialAccountAdapter' +SOCIALACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.SocialAccountAdapter" {% if cookiecutter.use_compressor == 'y' -%} # django-compressor # ------------------------------------------------------------------------------ # https://django-compressor.readthedocs.io/en/latest/quickstart/#installation -INSTALLED_APPS += ['compressor'] -STATICFILES_FINDERS += ['compressor.finders.CompressorFinder'] +INSTALLED_APPS += ["compressor"] +STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"] {%- endif %} # Your stuff... diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 6667a265..0c0588bd 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -6,42 +6,43 @@ from .base import env # https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key -SECRET_KEY = env('DJANGO_SECRET_KEY', default='!!!SET DJANGO_SECRET_KEY!!!') +SECRET_KEY = env( + "DJANGO_SECRET_KEY", + default="!!!SET DJANGO_SECRET_KEY!!!", +) # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts -ALLOWED_HOSTS = [ - "localhost", - "0.0.0.0", - "127.0.0.1", -] +ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"] # CACHES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#caches CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': '' + "default": { + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "", } } # TEMPLATES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]['OPTIONS']['debug'] = DEBUG # noqa F405 +TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405 # EMAIL # ------------------------------------------------------------------------------ {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-host -EMAIL_HOST = env('EMAIL_HOST', default='mailhog') +EMAIL_HOST = env("EMAIL_HOST", default="mailhog") {%- elif cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'n' -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-host -EMAIL_HOST = 'localhost' +EMAIL_HOST = "localhost" {%- else -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend -EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend') +EMAIL_BACKEND = env( + "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend" +) # https://docs.djangoproject.com/en/dev/ref/settings/#email-host -EMAIL_HOST = 'localhost' +EMAIL_HOST = "localhost" {%- endif %} # https://docs.djangoproject.com/en/dev/ref/settings/#email-port EMAIL_PORT = 1025 @@ -49,29 +50,28 @@ EMAIL_PORT = 1025 # django-debug-toolbar # ------------------------------------------------------------------------------ # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites -INSTALLED_APPS += ['debug_toolbar'] # noqa F405 +INSTALLED_APPS += ["debug_toolbar"] # noqa F405 # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware -MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware'] # noqa F405 +MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405 # https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config DEBUG_TOOLBAR_CONFIG = { - 'DISABLE_PANELS': [ - 'debug_toolbar.panels.redirects.RedirectsPanel', - ], - 'SHOW_TEMPLATE_CONTEXT': True, + "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"], + "SHOW_TEMPLATE_CONTEXT": True, } # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips -INTERNAL_IPS = ['127.0.0.1', '10.0.2.2'] +INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"] {% if cookiecutter.use_docker == 'y' -%} -if env('USE_DOCKER') == 'yes': +if env("USE_DOCKER") == "yes": import socket + hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) - INTERNAL_IPS += [ip[:-1] + '1' for ip in ips] + INTERNAL_IPS += [ip[:-1] + "1" for ip in ips] {%- endif %} # django-extensions # ------------------------------------------------------------------------------ # https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration -INSTALLED_APPS += ['django_extensions'] # noqa F405 +INSTALLED_APPS += ["django_extensions"] # noqa F405 {% 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 e77d4304..16158742 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -8,37 +8,37 @@ from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key -SECRET_KEY = env('DJANGO_SECRET_KEY') +SECRET_KEY = env("DJANGO_SECRET_KEY") # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts -ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['{{ cookiecutter.domain_name }}']) +ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS", default=["{{ cookiecutter.domain_name }}"]) # DATABASES # ------------------------------------------------------------------------------ -DATABASES['default'] = env.db('DATABASE_URL') # noqa F405 -DATABASES['default']['ATOMIC_REQUESTS'] = True # noqa F405 -DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', default=60) # noqa F405 +DATABASES["default"] = env.db("DATABASE_URL") # noqa F405 +DATABASES["default"]["ATOMIC_REQUESTS"] = True # noqa F405 +DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # noqa F405 # CACHES # ------------------------------------------------------------------------------ CACHES = { - 'default': { - 'BACKEND': 'django_redis.cache.RedisCache', - 'LOCATION': env('REDIS_URL'), - 'OPTIONS': { - 'CLIENT_CLASS': 'django_redis.client.DefaultClient', + "default": { + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": env("REDIS_URL"), + "OPTIONS": { + "CLIENT_CLASS": "django_redis.client.DefaultClient", # Mimicing memcache behavior. # http://niwinz.github.io/django-redis/latest/#_memcached_exceptions_behavior - 'IGNORE_EXCEPTIONS': True, - } + "IGNORE_EXCEPTIONS": True, + }, } } # SECURITY # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header -SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') +SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") # https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect -SECURE_SSL_REDIRECT = env.bool('DJANGO_SECURE_SSL_REDIRECT', default=True) +SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=True) # https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure SESSION_COOKIE_SECURE = True # https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure @@ -48,45 +48,49 @@ CSRF_COOKIE_SECURE = True # TODO: set this to 60 seconds first and then to 518400 once you prove the former works SECURE_HSTS_SECONDS = 60 # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains -SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool('DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS', default=True) +SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool( + "DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS", default=True +) # https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-preload -SECURE_HSTS_PRELOAD = env.bool('DJANGO_SECURE_HSTS_PRELOAD', default=True) +SECURE_HSTS_PRELOAD = env.bool("DJANGO_SECURE_HSTS_PRELOAD", default=True) # https://docs.djangoproject.com/en/dev/ref/middleware/#x-content-type-options-nosniff -SECURE_CONTENT_TYPE_NOSNIFF = env.bool('DJANGO_SECURE_CONTENT_TYPE_NOSNIFF', default=True) +SECURE_CONTENT_TYPE_NOSNIFF = env.bool( + "DJANGO_SECURE_CONTENT_TYPE_NOSNIFF", default=True +) # STORAGES # ------------------------------------------------------------------------------ # https://django-storages.readthedocs.io/en/latest/#installation -INSTALLED_APPS += ['storages'] # noqa F405 +INSTALLED_APPS += ["storages"] # noqa F405 # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings -AWS_ACCESS_KEY_ID = env('DJANGO_AWS_ACCESS_KEY_ID') +AWS_ACCESS_KEY_ID = env("DJANGO_AWS_ACCESS_KEY_ID") # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings -AWS_SECRET_ACCESS_KEY = env('DJANGO_AWS_SECRET_ACCESS_KEY') +AWS_SECRET_ACCESS_KEY = env("DJANGO_AWS_SECRET_ACCESS_KEY") # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings -AWS_STORAGE_BUCKET_NAME = env('DJANGO_AWS_STORAGE_BUCKET_NAME') +AWS_STORAGE_BUCKET_NAME = env("DJANGO_AWS_STORAGE_BUCKET_NAME") # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_QUERYSTRING_AUTH = False # DO NOT change these unless you know what you're doing. _AWS_EXPIRY = 60 * 60 * 24 * 7 # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_S3_OBJECT_PARAMETERS = { - 'CacheControl': f'max-age={_AWS_EXPIRY}, s-maxage={_AWS_EXPIRY}, must-revalidate', + "CacheControl": f"max-age={_AWS_EXPIRY}, s-maxage={_AWS_EXPIRY}, must-revalidate" } # STATIC # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} -STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' +STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {%- else %} -STATICFILES_STORAGE = 'config.settings.production.StaticRootS3Boto3Storage' -STATIC_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/' +STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" +STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {%- endif %} # MEDIA # ------------------------------------------------------------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} -DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' -MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/' +DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" +MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/" {%- else %} # region http://stackoverflow.com/questions/10390244/ # Full-fledge class: https://stackoverflow.com/a/18046120/104731 @@ -94,78 +98,79 @@ from storages.backends.s3boto3 import S3Boto3Storage # noqa E402 class StaticRootS3Boto3Storage(S3Boto3Storage): - location = 'static' + location = "static" class MediaRootS3Boto3Storage(S3Boto3Storage): - location = 'media' + location = "media" file_overwrite = False # endregion -DEFAULT_FILE_STORAGE = 'config.settings.production.MediaRootS3Boto3Storage' -MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/' +DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootS3Boto3Storage" +MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/media/" {%- endif %} # TEMPLATES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]['OPTIONS']['loaders'] = [ # noqa F405 +TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405 ( - 'django.template.loaders.cached.Loader', + "django.template.loaders.cached.Loader", [ - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - ] - ), + "django.template.loaders.filesystem.Loader", + "django.template.loaders.app_directories.Loader", + ], + ) ] # EMAIL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#default-from-email DEFAULT_FROM_EMAIL = env( - 'DJANGO_DEFAULT_FROM_EMAIL', - default='{{cookiecutter.project_name}} ' + "DJANGO_DEFAULT_FROM_EMAIL", default="{{cookiecutter.project_name}} " ) # https://docs.djangoproject.com/en/dev/ref/settings/#server-email -SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', default=DEFAULT_FROM_EMAIL) +SERVER_EMAIL = env("DJANGO_SERVER_EMAIL", default=DEFAULT_FROM_EMAIL) # https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix -EMAIL_SUBJECT_PREFIX = env('DJANGO_EMAIL_SUBJECT_PREFIX', default='[{{cookiecutter.project_name}}]') +EMAIL_SUBJECT_PREFIX = env( + "DJANGO_EMAIL_SUBJECT_PREFIX", default="[{{cookiecutter.project_name}}]" +) # ADMIN # ------------------------------------------------------------------------------ # Django Admin URL regex. -ADMIN_URL = env('DJANGO_ADMIN_URL') +ADMIN_URL = env("DJANGO_ADMIN_URL") # Anymail (Mailgun) # ------------------------------------------------------------------------------ # https://anymail.readthedocs.io/en/stable/installation/#installing-anymail -INSTALLED_APPS += ['anymail'] # noqa F405 -EMAIL_BACKEND = 'anymail.backends.mailgun.EmailBackend' +INSTALLED_APPS += ["anymail"] # noqa F405 +EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend" # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference ANYMAIL = { - 'MAILGUN_API_KEY': env('MAILGUN_API_KEY'), - 'MAILGUN_SENDER_DOMAIN': env('MAILGUN_DOMAIN') + "MAILGUN_API_KEY": env("MAILGUN_API_KEY"), + "MAILGUN_SENDER_DOMAIN": env("MAILGUN_DOMAIN"), } # Gunicorn # ------------------------------------------------------------------------------ -INSTALLED_APPS += ['gunicorn'] # noqa F405 +INSTALLED_APPS += ["gunicorn"] # noqa F405 {% if cookiecutter.use_whitenoise == 'y' -%} # WhiteNoise # ------------------------------------------------------------------------------ # http://whitenoise.evans.io/en/latest/django.html#enable-whitenoise -MIDDLEWARE.insert(1, 'whitenoise.middleware.WhiteNoiseMiddleware') # noqa F405 +MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # noqa F405 {% endif %} {%- if cookiecutter.use_compressor == 'y' -%} # django-compressor # ------------------------------------------------------------------------------ # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED -COMPRESS_ENABLED = env.bool('COMPRESS_ENABLED', default=True) +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' +COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL COMPRESS_URL = STATIC_URL @@ -174,7 +179,7 @@ COMPRESS_URL = STATIC_URL # Collectfast # ------------------------------------------------------------------------------ # https://github.com/antonagestam/collectfast#installation -INSTALLED_APPS = ['collectfast'] + INSTALLED_APPS # noqa F405 +INSTALLED_APPS = ["collectfast"] + INSTALLED_APPS # noqa F405 AWS_PRELOAD_METADATA = True {% endif %} @@ -182,64 +187,64 @@ AWS_PRELOAD_METADATA = True # raven # ------------------------------------------------------------------------------ # https://docs.sentry.io/clients/python/integrations/django/ -INSTALLED_APPS += ['raven.contrib.django.raven_compat'] # noqa F405 -MIDDLEWARE = ['raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware'] + MIDDLEWARE +INSTALLED_APPS += ["raven.contrib.django.raven_compat"] # noqa F405 +MIDDLEWARE = ["raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware"] + MIDDLEWARE # Sentry # ------------------------------------------------------------------------------ -SENTRY_DSN = env('SENTRY_DSN') -SENTRY_CLIENT = env('DJANGO_SENTRY_CLIENT', default='raven.contrib.django.raven_compat.DjangoClient') +SENTRY_DSN = env("SENTRY_DSN") +SENTRY_CLIENT = env("DJANGO_SENTRY_CLIENT", default="raven.contrib.django.raven_compat.DjangoClient") LOGGING = { - 'version': 1, - 'disable_existing_loggers': True, - 'root': { - 'level': 'WARNING', - 'handlers': ['sentry'], + "version": 1, + "disable_existing_loggers": True, + "root": { + "level": "WARNING", + "handlers": ["sentry"], }, - 'formatters': { - 'verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s ' - '%(process)d %(thread)d %(message)s' - }, - }, - 'handlers': { - 'sentry': { - 'level': 'ERROR', - 'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler', - }, - 'console': { - 'level': 'DEBUG', - 'class': 'logging.StreamHandler', - 'formatter': 'verbose' + "formatters": { + "verbose": { + "format": "%(levelname)s %(asctime)s %(module)s " + "%(process)d %(thread)d %(message)s" } }, - 'loggers': { - 'django.db.backends': { - 'level': 'ERROR', - 'handlers': ['console'], - 'propagate': False, + "handlers": { + "sentry": { + "level": "ERROR", + "class": "raven.contrib.django.raven_compat.handlers.SentryHandler", }, - 'raven': { - 'level': 'DEBUG', - 'handlers': ['console'], - 'propagate': False, + "console": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "formatter": "verbose", }, - 'sentry.errors': { - 'level': 'DEBUG', - 'handlers': ['console'], - 'propagate': False, + }, + "loggers": { + "django.db.backends": { + "level": "ERROR", + "handlers": ["console"], + "propagate": False, }, - 'django.security.DisallowedHost': { - 'level': 'ERROR', - 'handlers': ['console', 'sentry'], - 'propagate': False, + "raven": { + "level": "DEBUG", + "handlers": ["console"], + "propagate": False, + }, + "sentry.errors": { + "level": "DEBUG", + "handlers": ["console"], + "propagate": False, + }, + "django.security.DisallowedHost": { + "level": "ERROR", + "handlers": ["console", "sentry"], + "propagate": False, }, }, } -SENTRY_CELERY_LOGLEVEL = env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO) +SENTRY_CELERY_LOGLEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO) RAVEN_CONFIG = { - 'dsn': SENTRY_DSN + "dsn": SENTRY_DSN } {%- else %} @@ -252,43 +257,39 @@ RAVEN_CONFIG = { # 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, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' + "version": 1, + "disable_existing_loggers": False, + "filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}}, + "formatters": { + "verbose": { + "format": "%(levelname)s %(asctime)s %(module)s " + "%(process)d %(thread)d %(message)s" } }, - 'formatters': { - 'verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s ' - '%(process)d %(thread)d %(message)s' + "handlers": { + "mail_admins": { + "level": "ERROR", + "filters": ["require_debug_false"], + "class": "django.utils.log.AdminEmailHandler", + }, + "console": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "formatter": "verbose", }, }, - 'handlers': { - 'mail_admins': { - 'level': 'ERROR', - 'filters': ['require_debug_false'], - 'class': 'django.utils.log.AdminEmailHandler' + "loggers": { + "django.request": { + "handlers": ["mail_admins"], + "level": "ERROR", + "propagate": True, }, - 'console': { - 'level': 'DEBUG', - 'class': 'logging.StreamHandler', - 'formatter': 'verbose', + "django.security.DisallowedHost": { + "level": "ERROR", + "handlers": ["console", "mail_admins"], + "propagate": True, }, }, - 'loggers': { - 'django.request': { - 'handlers': ['mail_admins'], - 'level': 'ERROR', - 'propagate': True - }, - 'django.security.DisallowedHost': { - 'level': 'ERROR', - 'handlers': ['console', 'mail_admins'], - 'propagate': True - } - } } {% endif %} diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index e947d410..2ade134a 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -10,7 +10,10 @@ from .base import env # https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = False # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key -SECRET_KEY = env("DJANGO_SECRET_KEY", default="!!!SET DJANGO_SECRET_KEY!!!") +SECRET_KEY = env( + "DJANGO_SECRET_KEY", + default="!!!SET DJANGO_SECRET_KEY!!!", +) # https://docs.djangoproject.com/en/dev/ref/settings/#test-runner TEST_RUNNER = "django.test.runner.DiscoverRunner" @@ -19,7 +22,8 @@ TEST_RUNNER = "django.test.runner.DiscoverRunner" # https://docs.djangoproject.com/en/dev/ref/settings/#caches CACHES = { "default": { - "BACKEND": "django.core.cache.backends.locmem.LocMemCache", "LOCATION": "" + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "", } } diff --git a/{{cookiecutter.project_slug}}/config/urls.py b/{{cookiecutter.project_slug}}/config/urls.py index 62d86c94..909d5e86 100644 --- a/{{cookiecutter.project_slug}}/config/urls.py +++ b/{{cookiecutter.project_slug}}/config/urls.py @@ -8,22 +8,15 @@ from django.views import defaults as default_views urlpatterns = [ path("", TemplateView.as_view(template_name="pages/home.html"), name="home"), path( - "about/", - TemplateView.as_view(template_name="pages/about.html"), - name="about", + "about/", TemplateView.as_view(template_name="pages/about.html"), name="about" ), # Django Admin, use {% raw %}{% url 'admin:index' %}{% endraw %} path(settings.ADMIN_URL, admin.site.urls), # User management - path( - "users/", - include("{{ cookiecutter.project_slug }}.users.urls", namespace="users"), - ), + path("users/", include("{{ cookiecutter.project_slug }}.users.urls", namespace="users")), path("accounts/", include("allauth.urls")), # Your stuff: custom urls includes go here -] + static( - settings.MEDIA_URL, document_root=settings.MEDIA_ROOT -) +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: # This allows the error pages to be debugged during development, just visit diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index 4c135006..abc09314 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -20,11 +20,12 @@ from django.core.wsgi import get_wsgi_application # This allows easy placement of apps within the interior # {{ cookiecutter.project_slug }} directory. -app_path = os.path.abspath(os.path.join( - os.path.dirname(os.path.abspath(__file__)), os.pardir)) -sys.path.append(os.path.join(app_path, '{{ cookiecutter.project_slug }}')) +app_path = os.path.abspath( + os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) +) +sys.path.append(os.path.join(app_path, "{{ cookiecutter.project_slug }}")) {% if cookiecutter.use_sentry == 'y' -%} -if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production': +if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production": from raven.contrib.django.raven_compat.middleware.wsgi import Sentry {%- endif %} # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks @@ -38,7 +39,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") # setting points here. application = get_wsgi_application() {% if cookiecutter.use_sentry == 'y' -%} -if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production': +if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production": application = Sentry(application) {%- endif %} # Apply WSGI middleware here. diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index a496135b..c9fbb96e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -19,6 +19,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # ------------------------------------------------------------------------------ flake8==3.7.5 # https://github.com/PyCQA/flake8 coverage==4.5.2 # https://github.com/nedbat/coveragepy +black==18.9b0 # https://github.com/ambv/black # Django # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py index 570abc12..b3b086a0 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py @@ -1,4 +1,4 @@ -{% if cookiecutter.use_celery == 'y' %} +{% if cookiecutter.use_celery == 'y' -%} import os from celery import Celery from django.apps import apps, AppConfig @@ -7,26 +7,28 @@ 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 + os.environ.setdefault( + "DJANGO_SETTINGS_MODULE", "config.settings.local" + ) # pragma: no cover -app = Celery('{{cookiecutter.project_slug}}') +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') +app.config_from_object("django.conf:settings", namespace="CELERY") class CeleryAppConfig(AppConfig): - name = '{{cookiecutter.project_slug}}.taskapp' - verbose_name = 'Celery Config' + 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) + {%- if cookiecutter.use_sentry == 'y' %} - {% if cookiecutter.use_sentry == 'y' -%} if hasattr(settings, 'RAVEN_CONFIG'): # Celery signal registration {% if cookiecutter.use_pycharm == 'y' -%} @@ -51,7 +53,7 @@ class CeleryAppConfig(AppConfig): @app.task(bind=True) def debug_task(self): - print(f'Request: {self.request!r}') # pragma: no cover + 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 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py index 9361d6ec..0d206fae 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/adapters.py @@ -7,12 +7,10 @@ from django.http import HttpRequest class AccountAdapter(DefaultAccountAdapter): - def is_open_for_signup(self, request: HttpRequest): return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True) class SocialAccountAdapter(DefaultSocialAccountAdapter): - def is_open_for_signup(self, request: HttpRequest, sociallogin: Any): return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index 7bba81ff..250cc904 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -6,7 +6,6 @@ User = get_user_model() class UserChangeForm(forms.UserChangeForm): - class Meta(forms.UserChangeForm.Meta): model = User diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py index 00990576..b5371366 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py @@ -19,9 +19,7 @@ class UserFactory(DjangoModelFactory): digits=True, upper_case=True, lower_case=True, - ).generate( - extra_kwargs={} - ) + ).generate(extra_kwargs={}) self.set_password(password) class Meta: diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py index e8066164..dfa5da52 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_forms.py @@ -7,7 +7,6 @@ pytestmark = pytest.mark.django_db class TestUserCreationForm: - def test_clean_username(self): # A user with proto_user params does not exist yet. proto_user = UserFactory.build() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py index 0992e462..76cb80aa 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py @@ -40,7 +40,6 @@ class TestUserUpdateView: class TestUserRedirectView: - def test_get_redirect_url( self, user: settings.AUTH_USER_MODEL, request_factory: RequestFactory ): From 3bd7aa4e1a14763579824cbdf99e83eab9139466 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 18 Mar 2019 20:55:47 +0000 Subject: [PATCH 011/507] Fix build error with windows=y and docker=y combination Fixes #1917 --- {{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 e43b70af..b73e4602 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -2,7 +2,7 @@ pytz==2018.9 # https://github.com/stub42/pytz python-slugify==2.0.1 # https://github.com/un33k/python-slugify Pillow==5.4.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} -rcssmin==1.0.6{% if cookiecutter.windows == 'y' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin +rcssmin==1.0.6{% if cookiecutter.windows == 'y' and use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} From b312d516a422b08c299b57cdd3515a235f82b03e Mon Sep 17 00:00:00 2001 From: Demetris Date: Tue, 19 Mar 2019 11:32:45 +0200 Subject: [PATCH 012/507] Replace Caddy with Traefik (#1714) ## Description Replace Caddy with Traefik ## Rationale There is some trouble with the Caddy license (https://github.com/pydanny/cookiecutter-django/pull/1282#issuecomment-329617536) @drdaeman suggested using Traefik (https://github.com/pydanny/cookiecutter-django/pull/1282#issuecomment-353655273) which supports ACME and also plays very nice with Docker. ## Comments I am currently using the proposed setup on a live site and it working great so far. If this PR is of interest to the maintainers, then I could commit more changes and take care of the documentation. Of course, any suggestions by the more experienced people around here, are welcome! --- CONTRIBUTORS.rst | 2 + README.rst | 4 +- docs/deployment-with-docker.rst | 10 ++--- docs/developing-locally-docker.rst | 3 +- .../.envs/.production/.caddy | 3 -- .../compose/production/caddy/Caddyfile | 15 ------- .../compose/production/caddy/Dockerfile | 3 -- .../compose/production/traefik/Dockerfile | 5 +++ .../compose/production/traefik/traefik.toml | 41 +++++++++++++++++++ .../merge_production_dotenvs_in_dotenv.py | 1 - {{cookiecutter.project_slug}}/production.yml | 12 +++--- 11 files changed, 61 insertions(+), 38 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/.envs/.production/.caddy delete mode 100644 {{cookiecutter.project_slug}}/compose/production/caddy/Caddyfile delete mode 100644 {{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile create mode 100644 {{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile create mode 100644 {{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index dc41463f..d8d312ab 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -93,6 +93,7 @@ Listed in alphabetical order. Davit Tovmasyan `@davitovmasyan`_ Davur Clementsen `@dsclementsen`_ @davur Delio Castillo `@jangeador`_ @jangeador + Demetris Stavrou `@demestav`_ Denis Orehovsky `@apirobot`_ Dónal Adams `@epileptic-fish`_ Diane Chen `@purplediane`_ @purplediane88 @@ -216,6 +217,7 @@ Listed in alphabetical order. .. _@Collederas: https://github.com/Collederas .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto +.. _@demestav: https://github.com/demestav .. _@dezoito: https://github.com/dezoito .. _@dhepper: https://github.com/dhepper .. _@dot2dotseurat: https://github.com/dot2dotseurat diff --git a/README.rst b/README.rst index 37f36204..2c037e51 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ Features * Optional custom static build using Gulp and livereload * Send emails via Anymail_ (using Mailgun_ by default, but switchable) * Media storage using Amazon S3 -* Docker support using docker-compose_ for development and production (using Caddy_ with LetsEncrypt_ support) +* Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support) * Procfile_ for deploying to Heroku * Instructions for deploying to PythonAnywhere_ * Run tests with unittest or py.test @@ -82,7 +82,7 @@ Optional Integrations .. _Sentry: https://sentry.io/welcome/ .. _docker-compose: https://github.com/docker/compose .. _PythonAnywhere: https://www.pythonanywhere.com/ -.. _Caddy: https://caddyserver.com/ +.. _Traefik: https://traefik.io/ .. _LetsEncrypt: https://letsencrypt.org/ Constraints diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index f6e21e82..904947e3 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -19,7 +19,7 @@ Before you begin, check out the ``production.yml`` file in the root of this proj * ``django``: your application running behind ``Gunicorn``; * ``postgres``: PostgreSQL database with the application's relational data; * ``redis``: Redis instance for caching; -* ``caddy``: Caddy web server with HTTPS on by default. +* ``traefik``: Traefik reverse proxy with HTTPS on by default. Provided you have opted for Celery (via setting ``use_celery`` to ``y``) there are three more services: @@ -63,11 +63,11 @@ It is always better to deploy a site behind HTTPS and will become crucial as the * Access to the Django admin is set up by default to require HTTPS in production or once *live*. -The Caddy web server used in the default configuration will get you a valid certificate from Lets Encrypt and update it automatically. All you need to do to enable this is to make sure that your DNS records are pointing to the server Caddy runs on. +The Traefik reverse proxy used in the default configuration will get you a valid certificate from Lets Encrypt and update it automatically. All you need to do to enable this is to make sure that your DNS records are pointing to the server Traefik runs on. -You can read more about this here at `Automatic HTTPS`_ in the Caddy docs. +You can read more about this feature and how to configure it, at `Automatic HTTPS`_ in the Traefik docs. -.. _Automatic HTTPS: https://caddyserver.com/docs/automatic-https +.. _Automatic HTTPS: https://docs.traefik.io/configuration/acme/ (Optional) Postgres Data Volume Modifications @@ -112,7 +112,7 @@ If you want to scale your application, run:: docker-compose -f production.yml scale django=4 docker-compose -f production.yml scale celeryworker=2 -.. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``caddy``. +.. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``traefik``. To see how your containers are doing run:: diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 895140f9..10815419 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -105,7 +105,6 @@ The most important thing for us here now is ``env_file`` section enlisting ``./. │   ├── .django │   └── .postgres └── .production - ├── .caddy ├── .django └── .postgres @@ -120,7 +119,7 @@ Consider the aforementioned ``.envs/.local/.postgres``: :: POSTGRES_USER=XgOWtQtJecsAbaIyslwGvFvPawftNaqO POSTGRES_PASSWORD=jSljDz4whHuwO3aJIgVBrqEml5Ycbghorep4uVJ4xjDYQu0LfuTZdctj7y0YcCLu -The three envs we are presented with here are ``POSTGRES_DB``, ``POSTGRES_USER``, and ``POSTGRES_PASSWORD`` (by the way, their values have also been generated for you). You might have figured out already where these definitions will end up; it's all the same with ``django`` and ``caddy`` service container envs. +The three envs we are presented with here are ``POSTGRES_DB``, ``POSTGRES_USER``, and ``POSTGRES_PASSWORD`` (by the way, their values have also been generated for you). You might have figured out already where these definitions will end up; it's all the same with ``django`` service container envs. One final touch: should you ever need to merge ``.envs/production/*`` in a single ``.env`` run the ``merge_production_dotenvs_in_dotenv.py``: :: diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.caddy b/{{cookiecutter.project_slug}}/.envs/.production/.caddy deleted file mode 100644 index 83d7fc7a..00000000 --- a/{{cookiecutter.project_slug}}/.envs/.production/.caddy +++ /dev/null @@ -1,3 +0,0 @@ -# Caddy -# ------------------------------------------------------------------------------ -DOMAIN_NAME={{ cookiecutter.domain_name }} diff --git a/{{cookiecutter.project_slug}}/compose/production/caddy/Caddyfile b/{{cookiecutter.project_slug}}/compose/production/caddy/Caddyfile deleted file mode 100644 index 323e4392..00000000 --- a/{{cookiecutter.project_slug}}/compose/production/caddy/Caddyfile +++ /dev/null @@ -1,15 +0,0 @@ -www.{% raw %}{$DOMAIN_NAME}{% endraw %} { - redir https://{% raw %}{$DOMAIN_NAME}{% endraw %} -} - -{% raw %}{$DOMAIN_NAME}{% endraw %} { - proxy / django:5000 { - header_upstream Host {host} - header_upstream X-Real-IP {remote} - header_upstream X-Forwarded-Proto {scheme} - header_upstream X-CSRFToken {~csrftoken} - } - log stdout - errors stdout - gzip -} diff --git a/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile deleted file mode 100644 index c32efb3e..00000000 --- a/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM abiosoft/caddy:0.11.0 - -COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile new file mode 100644 index 00000000..7088e6fe --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -0,0 +1,5 @@ +FROM traefik:alpine +RUN mkdir -p /etc/traefik/acme +RUN touch /etc/traefik/acme/acme.json +RUN chmod 600 /etc/traefik/acme/acme.json +COPY ./compose/production/traefik/traefik.toml /etc/traefik diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml new file mode 100644 index 00000000..ad1f20e9 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml @@ -0,0 +1,41 @@ +logLevel = "INFO" +defaultEntryPoints = ["http", "https"] + +# Entrypoints, http and https +[entryPoints] + # http should be redirected to https + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + entryPoint = "https" + # https is the default + [entryPoints.https] + address = ":443" + [entryPoints.https.tls] + +# Enable ACME (Let's Encrypt): automatic SSL +[acme] +# Email address used for registration +email = "{{ cookiecutter.email }}" +storageFile = "/etc/traefik/acme/acme.json" +entryPoint = "https" +onDemand = false +OnHostRule = true + # Use a HTTP-01 acme challenge rather than TLS-SNI-01 challenge + [acme.httpChallenge] + entryPoint = "http" + +[file] +[backends] + [backends.django] + [backends.django.servers.server1] + url = "http://django:5000" + +[frontends] + [frontends.django] + backend = "django" + passHostHeader = true + [frontends.django.headers] + HostsProxyHeaders = ['X-CSRFToken'] + [frontends.django.routes.dr1] + rule = "Host:{{ cookiecutter.domain_name }}" diff --git a/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py b/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py index 5c3027a4..4e70e2ad 100644 --- a/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py +++ b/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py @@ -8,7 +8,6 @@ PRODUCTION_DOTENVS_DIR_PATH = os.path.join(ROOT_DIR_PATH, ".envs", ".production" PRODUCTION_DOTENV_FILE_PATHS = [ os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".django"), os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".postgres"), - os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".caddy"), ] DOTENV_FILE_PATH = os.path.join(ROOT_DIR_PATH, ".env") diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index fd8388ac..88cf8773 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -3,7 +3,7 @@ version: '3' volumes: production_postgres_data: {} production_postgres_data_backups: {} - production_caddy: {} + production_traefik: {} services: django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %} @@ -30,17 +30,15 @@ services: env_file: - ./.envs/.production/.postgres - caddy: + traefik: build: context: . - dockerfile: ./compose/production/caddy/Dockerfile - image: {{ cookiecutter.project_slug }}_production_caddy + dockerfile: ./compose/production/traefik/Dockerfile + image: {{ cookiecutter.project_slug }}_production_traefik depends_on: - django volumes: - - production_caddy:/root/.caddy - env_file: - - ./.envs/.production/.caddy + - production_traefik:/etc/traefik/acme ports: - "0.0.0.0:80:80" - "0.0.0.0:443:443" From e740a54da68b383d79ef33225d5c8ca5081eeced Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 19 Mar 2019 12:30:19 +0000 Subject: [PATCH 013/507] Update Flower version --- {{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 b73e4602..79999cb4 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -12,7 +12,7 @@ redis>=2.10.6, < 3 # pyup: < 3 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} celery==4.2.1 # pyup: < 5.0 # https://github.com/celery/celery {%- if cookiecutter.use_docker == 'y' %} -flower==0.9.2 # https://github.com/mher/flower +flower==0.9.3 # https://github.com/mher/flower {%- endif %} {%- endif %} From 6e9f87fced04ab76a133ae2fbd9b0bbbe52bd61f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 19 Mar 2019 19:57:31 +0000 Subject: [PATCH 014/507] Set AWS_DEFAULT_ACL to None as per django-storages documentation fixes #1885 --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 16158742..19195582 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -76,6 +76,8 @@ _AWS_EXPIRY = 60 * 60 * 24 * 7 AWS_S3_OBJECT_PARAMETERS = { "CacheControl": f"max-age={_AWS_EXPIRY}, s-maxage={_AWS_EXPIRY}, must-revalidate" } +# https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings +AWS_DEFAULT_ACL = None # STATIC # ------------------------ From b594a1584718775e4e8abd928a68213b899719f4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 19 Mar 2019 20:02:26 +0000 Subject: [PATCH 015/507] Add code style black to the generated README --- {{cookiecutter.project_slug}}/README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 49df7019..6ef3b63c 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -6,6 +6,9 @@ .. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg :target: https://github.com/pydanny/cookiecutter-django/ :alt: Built with Cookiecutter Django +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/ambv/black + :alt: Black code style {% if cookiecutter.open_source_license != "Not open source" %} :License: {{cookiecutter.open_source_license}} From 7d1e90bdf5343299c31388981b6af7cb0e631bbb Mon Sep 17 00:00:00 2001 From: Guilherme Fabrizio Date: Wed, 20 Mar 2019 10:04:44 +0000 Subject: [PATCH 016/507] Migrate to unified Sentry SDK (#1820) The raven library is deprecated. Replace it by the new sentry-sdk library: https://docs.sentry.io/error-reporting/quickstart/?platform=python fixes #1818 --- docs/settings.rst | 1 - .../config/settings/production.py | 132 ++++++++---------- {{cookiecutter.project_slug}}/config/wsgi.py | 8 -- .../requirements/production.txt | 4 +- .../taskapp/celery.py | 22 --- 5 files changed, 64 insertions(+), 103 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 26b161a0..705add87 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -45,7 +45,6 @@ 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 SENTRY_DSN SENTRY_DSN n/a raises error -DJANGO_SENTRY_CLIENT SENTRY_CLIENT n/a raven.contrib.django.raven_compat.DjangoClient 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 diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 19195582..546f2364 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -1,6 +1,14 @@ {% if cookiecutter.use_sentry == 'y' -%} import logging +import sentry_sdk + +from sentry_sdk.integrations.django import DjangoIntegration +from sentry_sdk.integrations.logging import LoggingIntegration +{%- if cookiecutter.use_celery == 'y' %} +from sentry_sdk.integrations.celery import CeleryIntegration +{% endif %} + {% endif -%} from .base import * # noqa from .base import env @@ -175,7 +183,6 @@ COMPRESS_ENABLED = env.bool("COMPRESS_ENABLED", default=True) COMPRESS_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL COMPRESS_URL = STATIC_URL - {% endif %} {%- if cookiecutter.use_whitenoise == 'n' -%} # Collectfast @@ -183,81 +190,16 @@ COMPRESS_URL = STATIC_URL # https://github.com/antonagestam/collectfast#installation INSTALLED_APPS = ["collectfast"] + INSTALLED_APPS # noqa F405 AWS_PRELOAD_METADATA = True - {% endif %} -{%- if cookiecutter.use_sentry == 'y' -%} -# raven -# ------------------------------------------------------------------------------ -# https://docs.sentry.io/clients/python/integrations/django/ -INSTALLED_APPS += ["raven.contrib.django.raven_compat"] # noqa F405 -MIDDLEWARE = ["raven.contrib.django.raven_compat.middleware.SentryResponseErrorIdMiddleware"] + MIDDLEWARE - -# Sentry -# ------------------------------------------------------------------------------ -SENTRY_DSN = env("SENTRY_DSN") -SENTRY_CLIENT = env("DJANGO_SENTRY_CLIENT", default="raven.contrib.django.raven_compat.DjangoClient") -LOGGING = { - "version": 1, - "disable_existing_loggers": True, - "root": { - "level": "WARNING", - "handlers": ["sentry"], - }, - "formatters": { - "verbose": { - "format": "%(levelname)s %(asctime)s %(module)s " - "%(process)d %(thread)d %(message)s" - } - }, - "handlers": { - "sentry": { - "level": "ERROR", - "class": "raven.contrib.django.raven_compat.handlers.SentryHandler", - }, - "console": { - "level": "DEBUG", - "class": "logging.StreamHandler", - "formatter": "verbose", - }, - }, - "loggers": { - "django.db.backends": { - "level": "ERROR", - "handlers": ["console"], - "propagate": False, - }, - "raven": { - "level": "DEBUG", - "handlers": ["console"], - "propagate": False, - }, - "sentry.errors": { - "level": "DEBUG", - "handlers": ["console"], - "propagate": False, - }, - "django.security.DisallowedHost": { - "level": "ERROR", - "handlers": ["console", "sentry"], - "propagate": False, - }, - }, -} - -SENTRY_CELERY_LOGLEVEL = env.int("DJANGO_SENTRY_LOG_LEVEL", logging.INFO) -RAVEN_CONFIG = { - "dsn": SENTRY_DSN -} - -{%- else %} # LOGGING # ------------------------------------------------------------------------------ -# See: https://docs.djangoproject.com/en/dev/ref/settings/#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. +{% if cookiecutter.use_sentry == 'n' -%} # A sample logging configuration. The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False. -# 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, @@ -293,7 +235,57 @@ LOGGING = { }, }, } +{% else %} +LOGGING = { + "version": 1, + "disable_existing_loggers": True, + "formatters": { + "verbose": { + "format": "%(levelname)s %(asctime)s %(module)s " + "%(process)d %(thread)d %(message)s" + } + }, + "handlers": { + "console": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "formatter": "verbose", + } + }, + "loggers": { + "django.db.backends": { + "level": "ERROR", + "handlers": ["console"], + "propagate": False, + }, + # Errors logged by the SDK itself + "sentry_sdk": {"level": "ERROR", "handlers": ["console"], "propagate": False}, + "django.security.DisallowedHost": { + "level": "ERROR", + "handlers": ["console"], + "propagate": False, + }, + }, +} +# Sentry +# ------------------------------------------------------------------------------ +SENTRY_DSN = env("SENTRY_DSN") +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 +) + +{%- if cookiecutter.use_celery == 'y' %} +sentry_sdk.init( + dsn=SENTRY_DSN, + integrations=[sentry_logging, DjangoIntegration(), CeleryIntegration()], +) +{% else %} +sentry_sdk.init(dsn=SENTRY_DSN, integrations=[sentry_logging, DjangoIntegration()]) +{% endif -%} {% endif %} # Your stuff... # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index abc09314..1899a30c 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -24,10 +24,6 @@ app_path = os.path.abspath( os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) ) sys.path.append(os.path.join(app_path, "{{ cookiecutter.project_slug }}")) -{% if cookiecutter.use_sentry == 'y' -%} -if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production": - from raven.contrib.django.raven_compat.middleware.wsgi import Sentry -{%- endif %} # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks # if running multiple sites in the same mod_wsgi process. To fix this, use # mod_wsgi daemon mode with each site in its own daemon process, or use @@ -38,10 +34,6 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. application = get_wsgi_application() -{% if cookiecutter.use_sentry == 'y' -%} -if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production": - application = Sentry(application) -{%- endif %} # Apply WSGI middleware here. # from helloworld.wsgi import HelloWorldApplication # application = HelloWorldApplication(application) diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 34877e3f..628a67bd 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,10 +8,10 @@ psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -raven==6.10.0 # https://github.com/getsentry/raven-python +sentry-sdk==0.7.6 # https://github.com/getsentry/sentry-python {%- endif %} # Django # ------------------------------------------------------------------------------ django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages -django-anymail[mailgun]==5.0 # https://github.com/anymail/django-anymail \ No newline at end of file +django-anymail[mailgun]==5.0 # https://github.com/anymail/django-anymail diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py index b3b086a0..529da1ae 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py @@ -27,28 +27,6 @@ class CeleryAppConfig(AppConfig): def ready(self): installed_apps = [app_config.name for app_config in apps.get_app_configs()] app.autodiscover_tasks(lambda: installed_apps, force=True) - {%- if cookiecutter.use_sentry == 'y' %} - - if hasattr(settings, 'RAVEN_CONFIG'): - # Celery signal registration -{% if cookiecutter.use_pycharm == 'y' -%} - # Since raven is required in production only, - # imports might (most surely will) be wiped out - # during PyCharm code clean up started - # in other environments. - # @formatter:off -{%- endif %} - from raven import Client as RavenClient - from raven.contrib.celery import register_signal as raven_register_signal - from raven.contrib.celery import register_logger_signal as raven_register_logger_signal -{% if cookiecutter.use_pycharm == 'y' -%} - # @formatter:on -{%- endif %} - - raven_client = RavenClient(dsn=settings.RAVEN_CONFIG['dsn']) - raven_register_logger_signal(raven_client) - raven_register_signal(raven_client) - {%- endif %} @app.task(bind=True) From 5bf0a397ac2fef207b817cff99f08373841b7eb9 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 20 Mar 2019 12:09:43 +0000 Subject: [PATCH 017/507] Pin redis version --- {{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 6f9cd64f..cbc9485f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.2 # https://github.com/evansd/whitenoise {%- endif %} -redis>=3.2.0 # https://github.com/antirez/redis +redis==3.2.1 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} celery==4.2.1 # pyup: < 5.0 # https://github.com/celery/celery kombu==4.4.0 # https://github.com/celery/kombu From f1def67b6d70dd8ef31d8e38bbf9faaa0db8f483 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 20 Mar 2019 12:12:32 +0000 Subject: [PATCH 018/507] Fix broken links in list of contributors --- CONTRIBUTORS.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index d804a970..b7607562 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -46,7 +46,7 @@ Listed in alphabetical order. Aaron Eikenberry `@aeikenberry`_ Adam Bogdał `@bogdal`_ Adam Dobrawy `@ad-m`_ - Adam Steele `@adammsteele` + Adam Steele `@adammsteele`_ Agam Dua Alberto Sanchez `@alb3rto`_ Alex Tsai `@caffodian`_ @@ -64,14 +64,14 @@ Listed in alphabetical order. Areski Belaid `@areski`_ Ashley Camba Barclay Gauld `@yunti`_ - Ben Warren `@bwarren2` + Ben Warren `@bwarren2`_ Ben Lopatin Benjamin Abel Bert de Miranda `@bertdemiranda`_ Bo Lopker `@blopker`_ Bouke Haarsma Brent Payne `@brentpayne`_ @brentpayne - Bartek `@btknu` + Bartek `@btknu`_ Burhan Khalid            `@burhan`_                   @burhan Carl Johnson `@carlmjohnson`_ @carlmjohnson Catherine Devlin `@catherinedevlin`_ @@ -159,7 +159,7 @@ Listed in alphabetical order. Roman Afanaskin `@siauPatrick`_ Roman Osipenko `@romanosipenko`_ Russell Davies - Sascha `@saschalalala` @saschalalala + Sascha `@saschalalala`_ @saschalalala Sam Collins `@MightySCollins`_ Shupeyko Nikita `@webyneter`_ Sławek Ehlert `@slafs`_ @@ -304,6 +304,14 @@ Listed in alphabetical order. .. _@ahhda: https://github.com/ahhda .. _@keithjeb: https://github.com/keithjeb .. _@btknu: https://github.com/btknu +.. _@rolep: https://github.com/rolep +.. _@canonnervio: https://github.com/canonnervio +.. _@jcass77: https://github.com/jcass77 +.. _@Egregors: https://github.com/Egregors +.. _@saschalalala: https://github.com/saschalalala +.. _@mrcoles: https://github.com/mrcoles +.. _@ericgroom: https://github.com/ericgroom + Special Thanks ~~~~~~~~~~~~~~ From 823ee637d14fe163cf9c3563a9fc37a01497601a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 20 Mar 2019 12:16:43 +0000 Subject: [PATCH 019/507] Remove dead link in .gitignore Fixes #1972 --- {{cookiecutter.project_slug}}/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index 1874e9d9..cb8ad835 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -325,7 +325,6 @@ tags ### VirtualEnv template # Virtualenv -# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ [Bb]in [Ii]nclude [Ll]ib From 91585a0eb23b8c244e664e6078e2da525e2d14de Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 20 Mar 2019 12:54:58 +0000 Subject: [PATCH 020/507] Add OS requirements for Ubuntu Bionic 18.04 Fixes #1973 --- .../utility/requirements-bionic.apt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/utility/requirements-bionic.apt diff --git a/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt b/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt new file mode 100644 index 00000000..1ca82b26 --- /dev/null +++ b/{{cookiecutter.project_slug}}/utility/requirements-bionic.apt @@ -0,0 +1,23 @@ +##basic build dependencies of various Django apps for Ubuntu Bionic 18.04 +#build-essential metapackage install: make, gcc, g++, +build-essential +#required to translate +gettext +python3-dev + +##shared dependencies of: +##Pillow, pylibmc +zlib1g-dev + +##Postgresql and psycopg2 dependencies +libpq-dev + +##Pillow dependencies +libtiff5-dev +libjpeg8-dev +libfreetype6-dev +liblcms2-dev +libwebp-dev + +##django-extensions +libgraphviz-dev From 1ed1e6ac47d9ee9101034a110762e0074060894a Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:00:43 +0000 Subject: [PATCH 021/507] Update sentry-sdk from 0.7.6 to 0.7.7 --- {{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 628a67bd..07e76646 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.7.4 --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.6 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.7 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 4cd30e4657e2dbce3c7d19d02e9db2ae5ed8e6fd Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:00:47 +0000 Subject: [PATCH 022/507] Update django-anymail from 5.0 to 6.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 628a67bd..e4f09c38 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -14,4 +14,4 @@ sentry-sdk==0.7.6 # https://github.com/getsentry/sentry-python # Django # ------------------------------------------------------------------------------ django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages -django-anymail[mailgun]==5.0 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==6.0 # https://github.com/anymail/django-anymail From bb26ed565beca0cc9c04199eec6b4e9fa66ee69d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:00:50 +0000 Subject: [PATCH 023/507] Update python-slugify from 2.0.1 to 3.0.0 --- {{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 cbc9485f..fdfec62b 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2018.9 # https://github.com/stub42/pytz -python-slugify==2.0.1 # https://github.com/un33k/python-slugify +python-slugify==3.0.0 # https://github.com/un33k/python-slugify Pillow==5.4.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From dd85d6df39cb3167a39a613ec2ceb4c7f9c0722b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:00:57 +0000 Subject: [PATCH 024/507] Update django-allauth from 0.38.0 to 0.39.1 --- {{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 cbc9485f..956587ef 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -22,7 +22,7 @@ flower==0.9.3 # https://github.com/mher/flower django==2.0.13 # pyup: < 2.1 # 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.38.0 # https://github.com/pennersr/django-allauth +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 From f04e96e30f3efb266e03555ce61929e966f4db23 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:00 +0000 Subject: [PATCH 025/507] Update djangorestframework from 3.9.1 to 3.9.2 --- {{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 cbc9485f..fe5aaf26 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,5 +30,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.1 # https://github.com/encode/django-rest-framework +djangorestframework==3.9.2 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From 7b83d47e2b44ea60d9e65696889aa470b3522b42 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:05 +0000 Subject: [PATCH 026/507] Update werkzeug from 0.14.1 to 0.15.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 c9fbb96e..8c7bc694 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.1 # https://github.com/pallets/werkzeug +Werkzeug==0.15.0 # https://github.com/pallets/werkzeug ipdb==0.11 # https://github.com/gotcha/ipdb Sphinx==1.8.4 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From f67a78903ef67148b1b3d7c1d4807f396ab06494 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:08 +0000 Subject: [PATCH 027/507] Update ipdb from 0.11 to 0.12 --- {{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 c9fbb96e..3e56c1bc 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ -r ./base.txt Werkzeug==0.14.1 # https://github.com/pallets/werkzeug -ipdb==0.11 # https://github.com/gotcha/ipdb +ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==1.8.4 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 From b5ab945ca2b6b50fcee8708d9e8b1c4db86e30d7 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:14 +0000 Subject: [PATCH 028/507] Update sphinx from 1.8.4 to 1.8.5 --- {{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 c9fbb96e..7159a06e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.14.1 # https://github.com/pallets/werkzeug ipdb==0.11 # https://github.com/gotcha/ipdb -Sphinx==1.8.4 # https://github.com/sphinx-doc/sphinx +Sphinx==1.8.5 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From a7163b9409543e69026896b70a4d8ff45b9bb716 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:18 +0000 Subject: [PATCH 029/507] Update pytest from 4.2.0 to 4.3.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 c9fbb96e..0c77b17b 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.7.7 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.670 # https://github.com/python/mypy -pytest==4.2.0 # https://github.com/pytest-dev/pytest +pytest==4.3.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 3995e9e807297167bfed646597e4863c991f9317 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:21 +0000 Subject: [PATCH 030/507] Update coverage from 4.5.2 to 4.5.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 c9fbb96e..6b830959 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -18,7 +18,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ flake8==3.7.5 # https://github.com/PyCQA/flake8 -coverage==4.5.2 # https://github.com/nedbat/coveragepy +coverage==4.5.3 # https://github.com/nedbat/coveragepy black==18.9b0 # https://github.com/ambv/black # Django From d92754684f89450a05020fda90bcd2acc4345a15 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:24 +0000 Subject: [PATCH 031/507] Update black from 18.9b0 to 19.3b0 --- {{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 c9fbb96e..f8e3e96c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -19,7 +19,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # ------------------------------------------------------------------------------ flake8==3.7.5 # https://github.com/PyCQA/flake8 coverage==4.5.2 # https://github.com/nedbat/coveragepy -black==18.9b0 # https://github.com/ambv/black +black==19.3b0 # https://github.com/ambv/black # Django # ------------------------------------------------------------------------------ From a8c52e2d455a82d43dda8021ca4691776b27f3d0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:28 +0000 Subject: [PATCH 032/507] Update django-extensions from 2.1.5 to 2.1.6 --- {{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 c9fbb96e..18ef4aac 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -26,6 +26,6 @@ black==18.9b0 # https://github.com/ambv/black factory-boy==2.11.1 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==1.11 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.1.5 # https://github.com/django-extensions/django-extensions +django-extensions==2.1.6 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.4.7 # https://github.com/pytest-dev/pytest-django From 65d315ed292224039e4fc2f76c8b7bb1954992fc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Mar 2019 16:01:31 +0000 Subject: [PATCH 033/507] Update pytest-django from 3.4.7 to 3.4.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 c9fbb96e..70ebedfc 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -28,4 +28,4 @@ factory-boy==2.11.1 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==1.11 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.1.5 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin -pytest-django==3.4.7 # https://github.com/pytest-dev/pytest-django +pytest-django==3.4.8 # https://github.com/pytest-dev/pytest-django From 7f3aa6cebb9f2efb188e2b01acd90b184e2e72b3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 22 Mar 2019 11:00:31 +0000 Subject: [PATCH 034/507] Update werkzeug from 0.15.0 to 0.15.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 2fa606c1..df1ef007 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.0 # https://github.com/pallets/werkzeug +Werkzeug==0.15.1 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==1.8.5 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From 85aea55fc64d117a31ffe50e481a1e2de17e3385 Mon Sep 17 00:00:00 2001 From: Hana Quadara Date: Sat, 23 Mar 2019 00:01:23 -0400 Subject: [PATCH 035/507] add plugins to req file; remove pylint-common --- docs/linters.rst | 2 +- requirements.txt | 2 ++ {{cookiecutter.project_slug}}/.pylintrc | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/linters.rst b/docs/linters.rst index e59ff0df..2d623218 100644 --- a/docs/linters.rst +++ b/docs/linters.rst @@ -25,7 +25,7 @@ This is included in flake8's checks, but you can also run it separately to see a The config for pylint is located in .pylintrc. It specifies: -* Use the pylint_common and pylint_django plugins. If using Celery, also use pylint_celery. +* Use the pylint_django plugin. If using Celery, also use pylint_celery. * Set max line length to 120 chars * Disable linting messages for missing docstring and invalid name * max-parents=13 diff --git a/requirements.txt b/requirements.txt index 647bccae..ce2cd07e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,8 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ flake8==3.7.6 +pylint-django==0.9.4 +pylint-celery==0.3 # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/.pylintrc b/{{cookiecutter.project_slug}}/.pylintrc index 1a199286..a0955f07 100644 --- a/{{cookiecutter.project_slug}}/.pylintrc +++ b/{{cookiecutter.project_slug}}/.pylintrc @@ -1,5 +1,5 @@ [MASTER] -load-plugins=pylint_common, pylint_django{% if cookiecutter.use_celery == "y" %}, pylint_celery {% endif %} +load-plugins=pylint_django{% if cookiecutter.use_celery == "y" %}, pylint_celery {% endif %} [FORMAT] max-line-length=120 From 015319ca3f63fd4720dda4737ac5c56764ea75ef Mon Sep 17 00:00:00 2001 From: Hana Quadara Date: Sat, 23 Mar 2019 00:26:13 -0400 Subject: [PATCH 036/507] add username to contributors --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index b7607562..24d8fda6 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -106,6 +106,7 @@ Listed in alphabetical order. Garry Cairns `@garry-cairns`_ Garry Polley `@garrypolley`_ Hamish Durkin `@durkode`_ + Hana Quadara `@hanaquadara`_ Harry Percival `@hjwp`_ Hendrik Schneider `@hendrikschneider`_ Henrique G. G. Pereira `@ikkebr`_ From b91c70d75578e56c2ca74400684c5b5523cd0cd4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 25 Mar 2019 12:10:55 +0000 Subject: [PATCH 037/507] Add a node image to run Gulp when selecting it with Docker (#1687) ## Description Following up on @webyneter attempt in #1205, which is now getting outdated, I've tried to make Gulp task runner work with Docker. There is no documentation yet, but this seems to work locally with the custom bootstrap compilation... - [x] Add a node image for local developement - [x] Proxy the django image rather than localhost in Browser sync, pass header to keep hostname - [x] Don't call the runserver command from Gulp, let docker-compose handle - [x] Update package.json & gulpfile.js templates to reduce the number of unwanted empty lines - [x] Use [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) in production to make sure the static assets are produced - [x] Update documentation - [x] Verify that the previous issue with static assets missing from production isn't there ## Rationale Currently, the static build isn't working nicely with Docker, extra manual setup is required. Fixes #1762 --- docs/deployment-with-docker.rst | 5 +++-- hooks/post_gen_project.py | 21 ++++++------------- .../compose/local/node/Dockerfile | 9 ++++++++ .../compose/production/django/Dockerfile | 21 +++++++++++++++++-- {{cookiecutter.project_slug}}/gulpfile.js | 20 +++++++++++++++++- {{cookiecutter.project_slug}}/local.yml | 20 ++++++++++++++++++ {{cookiecutter.project_slug}}/package.json | 5 +++-- .../templates/base.html | 8 +++---- 8 files changed, 83 insertions(+), 26 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/compose/local/node/Dockerfile diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 904947e3..4ab2312e 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -7,8 +7,8 @@ Deployment with Docker Prerequisites ------------- -* Docker 1.10+. -* Docker Compose 1.6+ +* Docker 17.05+. +* Docker Compose 1.17+ Understanding the Docker Compose Setup @@ -144,3 +144,4 @@ Move it to ``/etc/supervisor/conf.d/{{cookiecutter.project_slug}}.conf`` and run For status check, run:: supervisorctl status + diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index a9c1c941..ab05b375 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -267,6 +267,10 @@ def remove_celery_compose_dirs(): shutil.rmtree(os.path.join("compose", "production", "django", "celery")) +def remove_node_dockerfile(): + shutil.rmtree(os.path.join("compose", "local", "node")) + + def main(): debug = "{{ cookiecutter.debug }}".lower() == "y" @@ -313,21 +317,8 @@ def main(): if "{{ cookiecutter.js_task_runner}}".lower() == "none": remove_gulp_files() remove_packagejson_file() - if ( - "{{ cookiecutter.js_task_runner }}".lower() != "none" - and "{{ cookiecutter.use_docker }}".lower() == "y" - ): - print( - WARNING - + "Docker and {} JS task runner ".format( - "{{ cookiecutter.js_task_runner }}".lower().capitalize() - ) - + "working together not supported yet. " - "You can continue using the generated project like you " - "normally would, however you would need to add a JS " - "task runner service to your Docker Compose configuration " - "manually." + TERMINATOR - ) + if "{{ cookiecutter.use_docker }}".lower() == "y": + remove_node_dockerfile() if "{{ cookiecutter.use_celery }}".lower() == "n": remove_celery_app() diff --git a/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile new file mode 100644 index 00000000..f9976e20 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/local/node/Dockerfile @@ -0,0 +1,9 @@ +FROM node:10-stretch-slim + +WORKDIR /app + +COPY ./package.json /app + +RUN npm install && npm cache clean --force + +ENV PATH ./node_modules/.bin/:$PATH diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 68d72327..80b5bc2c 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -1,3 +1,14 @@ +{% if cookiecutter.js_task_runner == 'Gulp' -%} +FROM node:10-stretch-slim as client-builder + +WORKDIR /app +COPY ./package.json /app +RUN npm install && npm cache clean --force +COPY . /app +RUN npm run build + +# Python build stage +{%- endif %} FROM python:3.6-alpine ENV PYTHONUNBUFFERED 1 @@ -28,7 +39,8 @@ COPY ./compose/production/django/start /start RUN sed -i 's/\r//' /start RUN chmod +x /start RUN chown django /start -{% if cookiecutter.use_celery == "y" %} + +{%- if cookiecutter.use_celery == "y" %} COPY ./compose/production/django/celery/worker/start /start-celeryworker RUN sed -i 's/\r//' /start-celeryworker RUN chmod +x /start-celeryworker @@ -42,8 +54,13 @@ RUN chown django /start-celerybeat COPY ./compose/production/django/celery/flower/start /start-flower RUN sed -i 's/\r//' /start-flower RUN chmod +x /start-flower -{% endif %} +{%- endif %} + +{%- if cookiecutter.js_task_runner == 'Gulp' %} +COPY --from=client-builder /app /app +{% else %} COPY . /app +{%- endif %} RUN chown -R django /app diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index d92678ed..3c28a735 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -127,7 +127,23 @@ function initBrowserSync() { `${paths.js}/*.js`, `${paths.templates}/*.html` ], { - proxy: "localhost:8000" + // https://www.browsersync.io/docs/options/#option-proxy + {%- if cookiecutter.use_docker == 'n' %} + proxy: 'localhost:8000' + {% else %} + proxy: { + target: 'django:8000', + proxyReq: [ + function(proxyReq, req) { + // Assign proxy "host" header same as current request at Browsersync server + proxyReq.setHeader('Host', req.headers.host) + } + ] + }, + // https://www.browsersync.io/docs/options/#option-open + // Disable as it doesn't work from inside a container + open: false + {%- endif %} } ) } @@ -149,7 +165,9 @@ const generateAssets = parallel( // Set up dev environment const dev = parallel( + {%- if cookiecutter.use_docker == 'n' %} runServer, + {%- endif %} initBrowserSync, watchPaths ) diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index 36638932..c6dd654e 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -79,3 +79,23 @@ services: command: /start-flower {%- endif %} + {%- if cookiecutter.js_task_runner == 'Gulp' %} + + node: + build: + context: . + dockerfile: ./compose/local/node/Dockerfile + image: {{ cookiecutter.project_slug }}_local_node + depends_on: + - django + volumes: + - .:/app + # http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html + - /app/node_modules + command: npm run dev + ports: + - "3000:3000" + # Expose browsersync UI: https://www.browsersync.io/docs/options/#option-ui + - "3001:3001" + + {%- endif %} diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index a15df941..6edf2e11 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -5,7 +5,7 @@ "devDependencies": { {% if cookiecutter.js_task_runner == 'Gulp' -%} {% if cookiecutter.custom_bootstrap_compilation == 'y' -%} - "bootstrap": "4.1.1", + "bootstrap": "4.3.1", "gulp-concat": "^2.6.1", "jquery": "3.3.1", "popper.js": "1.14.3", @@ -31,7 +31,8 @@ ], "scripts": { {% if cookiecutter.js_task_runner == 'Gulp' -%} - "dev": "gulp" + "dev": "gulp", + "build": "gulp generate-assets" {%- endif %} } } diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 4470e955..9caab43a 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -17,8 +17,8 @@ {% block css %} {% endraw %}{% if cookiecutter.custom_bootstrap_compilation == "n" %}{% raw %} - - + + {% endraw %}{% endif %}{% raw %} @@ -102,10 +102,10 @@ {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endraw %}{% else %}{% raw %} - + - + {% endraw %}{% endif %}{% raw %} From ec79f1f6763e097df152649353bea5f08ffa2023 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 25 Mar 2019 19:04:47 +0000 Subject: [PATCH 038/507] Rename test phases in Travis build matrix --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 65b2a28d..a74090b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,9 +13,9 @@ before_install: matrix: include: - - name: Test + - name: Tox Test script: tox -e py36 - - name: Black + - name: Black template script: tox -e black - name: Basic Docker script: sh tests/test_docker.sh From b261ce27c4351996d5186f37a56c3b72e6330e0c Mon Sep 17 00:00:00 2001 From: hanasuhail Date: Mon, 25 Mar 2019 15:52:49 -0400 Subject: [PATCH 039/507] update restructured text link; add condition for celery linter --- CONTRIBUTORS.rst | 1 + requirements.txt | 2 -- {{cookiecutter.project_slug}}/requirements/local.txt | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 24d8fda6..154fa1ac 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -312,6 +312,7 @@ Listed in alphabetical order. .. _@saschalalala: https://github.com/saschalalala .. _@mrcoles: https://github.com/mrcoles .. _@ericgroom: https://github.com/ericgroom +.. _@hanaquadara: https://github.com/hanaquadara Special Thanks ~~~~~~~~~~~~~~ diff --git a/requirements.txt b/requirements.txt index ce2cd07e..647bccae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,6 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ flake8==3.7.6 -pylint-django==0.9.4 -pylint-celery==0.3 # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index df1ef007..d3ad17fd 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -20,6 +20,10 @@ 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==0.9.4 +{%- if cookiecutter.use_celery == 'y' %} +pylint-celery==0.3 +{%- endif %} # Django # ------------------------------------------------------------------------------ From 5db400fbcf6263cbefb18a0d28ae7c448e785c14 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 26 Mar 2019 11:00:32 +0000 Subject: [PATCH 040/507] Update sentry-sdk from 0.7.7 to 0.7.8 --- {{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 1d842de4..17b9d00c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.7.4 --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.7 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.8 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 99d7e1d5efd9328c5ce4aa94510efcf1070885a2 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 26 Mar 2019 11:00:35 +0000 Subject: [PATCH 041/507] Update python-slugify from 3.0.0 to 3.0.1 --- {{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 e26f6536..e0a76232 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2018.9 # https://github.com/stub42/pytz -python-slugify==3.0.0 # https://github.com/un33k/python-slugify +python-slugify==3.0.1 # https://github.com/un33k/python-slugify Pillow==5.4.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From c2f8569eb375d6e4d5ef80c32c339a8529478678 Mon Sep 17 00:00:00 2001 From: hanasuhail Date: Tue, 26 Mar 2019 17:16:40 -0400 Subject: [PATCH 042/507] add sources --- {{cookiecutter.project_slug}}/requirements/local.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index d3ad17fd..066f01ad 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -20,9 +20,9 @@ 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==0.9.4 +pylint-django==0.9.4 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} -pylint-celery==0.3 +pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} # Django From 9e93adaf98a1da5b4befe113f22a2ae646094d36 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 26 Mar 2019 21:20:56 +0000 Subject: [PATCH 043/507] Add documentation to include optional integrations fixes #449 --- docs/deployment-on-heroku.rst | 65 +++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst index 09953cf8..6f3076bc 100644 --- a/docs/deployment-on-heroku.rst +++ b/docs/deployment-on-heroku.rst @@ -17,11 +17,8 @@ Run these commands to deploy the project to Heroku: heroku addons:create heroku-redis:hobby-dev - # If using mailgun: heroku addons:create mailgun:starter - heroku addons:create sentry:f1 - heroku config:set PYTHONHASHSEED=random heroku config:set WEB_CONCURRENCY=4 @@ -52,3 +49,65 @@ Run these commands to deploy the project to Heroku: heroku run python manage.py check --deploy heroku open + + +Optional actions +---------------- + +Celery +++++++ + +Celery requires a few extra environment variables to be ready operational. Also, the worker is created, +it's in the ``Procfile``, but is turned off by default: + +.. code-block:: bash + + # Set the broker URL to Redis + heroku config:set CELERY_BROKER_URL=`heroku config:get REDIS_URL` + # Scale dyno to 1 instance + heroku ps:scale worker=1 + +Sentry +++++++ + +If you're opted for Sentry error tracking, you can either install it through the `Sentry add-on`_: + +.. code-block:: bash + + heroku addons:create sentry:f1 + + +Or add the DSN for your account, if you already have one: + +.. code-block:: bash + + heroku config:set SENTRY_DSN=https://xxxx@sentry.io/12345 + +.. _Sentry add-on: https://elements.heroku.com/addons/sentry + + +Gulp & Bootstrap compilation +++++++++++++++++++++++++++++ + +If you've opted for a custom bootstrap build, you'll most likely need to setup +your app to use `multiple buildpacks`_: one for Python & one for Node.js: + +.. code-block:: bash + + heroku buildpacks:add --index 1 heroku/nodejs + +At time of writing, this should do the trick: during deployment, +the Heroku should run ``npm install`` and then ``npm build``, +which runs Gulp in cookiecutter-django. + +If things don't work, please refer to the Heroku docs. + +.. _multiple buildpacks: https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app + +About Heroku & Docker +--------------------- + +Although Heroku has some sort of `Docker support`_, it's not supported by cookiecutter-django. +We invite you to follow Heroku documentation about it. + +.. _Docker support:: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml From eb3325f767264190fbc1305547d7d3bfd8bedb06 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 26 Mar 2019 21:36:38 +0000 Subject: [PATCH 044/507] Add documentation about Mailgun setup fixes #1705 --- docs/deployment-on-heroku.rst | 5 +++++ docs/deployment-with-docker.rst | 5 +++++ docs/mailgun.rst | 13 +++++++++++++ docs/troubleshooting.rst | 2 ++ 4 files changed, 25 insertions(+) create mode 100644 docs/mailgun.rst diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst index 6f3076bc..8cc3a6b5 100644 --- a/docs/deployment-on-heroku.rst +++ b/docs/deployment-on-heroku.rst @@ -51,6 +51,11 @@ Run these commands to deploy the project to Heroku: heroku open +.. warning:: + + .. include:: mailgun.rst + + Optional actions ---------------- diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 4ab2312e..aad54932 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -43,6 +43,11 @@ You will probably also need to setup the Mail backend, for example by adding a ` .. _Mailgun: https://mailgun.com +.. warning:: + + .. include:: mailgun.rst + + Optional: Use AWS IAM Role for EC2 instance ------------------------------------------- diff --git a/docs/mailgun.rst b/docs/mailgun.rst new file mode 100644 index 00000000..1f34e3c8 --- /dev/null +++ b/docs/mailgun.rst @@ -0,0 +1,13 @@ +If your email server used to send email isn't configured properly (Mailgun by default), +attempting to send an email will cause an Internal Server Error. + +By default, django-allauth is setup to `have emails verifications mandatory`_, +which means it'll send a verification email when an unverified user tries to +log-in or when someone tries to sign-up. + +This may happen just after you've setup your Mailgun account, which is running in a +sandbox subdomain by default. Either add your email to the list of authorized recipients +or verify your domain. + + +.. _have emails verifications mandatory: https://django-allauth.readthedocs.io/en/latest/configuration.html?highlight=ACCOUNT_EMAIL_VERIFICATION diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index d0c0ba43..68db2fb0 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -11,5 +11,7 @@ This page contains some advice about errors and problems commonly encountered du #. 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 + .. _#528: https://github.com/pydanny/cookiecutter-django/issues/528#issuecomment-212650373 .. _#1725: https://github.com/pydanny/cookiecutter-django/issues/1725#issuecomment-407493176 From 28c60116a6a9e8eaa1131da7223e67872787b370 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 27 Mar 2019 11:00:31 +0000 Subject: [PATCH 045/507] Update pylint-django from 0.9.4 to 2.0.6 --- {{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 066f01ad..0c6886f7 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==0.9.4 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.6 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From 7e60f1259a3d25b25d6dd4eec19bc2a88335fc44 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 27 Mar 2019 14:15:44 -0700 Subject: [PATCH 046/507] Update tox from 3.6.1 to 3.8.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 647bccae..01e826cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.6.1 +tox==3.8.0 pytest==4.3.1 pytest-cookies==0.3.0 pyyaml==5.1 From becd2dce1329670f5286ac6435e5ef9b7d8ae8aa Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 27 Mar 2019 21:27:52 +0000 Subject: [PATCH 047/507] Reword & clarify Python 2 warning in pre gen hook Fixes #1942 --- hooks/pre_gen_project.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index a6b83455..e7bc1e39 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -30,9 +30,8 @@ if "{{ cookiecutter.use_docker }}".lower() == "n": python_major_version = sys.version_info[0] if python_major_version == 2: print( - WARNING + "Cookiecutter Django does not support Python 2. " - "Stability is guaranteed with Python 3.6+ only, " - "are you sure you want to proceed (y/n)? " + TERMINATOR + WARNING + "You're running cookiecutter under Python 2, but the generated " + "project requires Python 3.6+. Do you want to proceed (y/n)? " + TERMINATOR ) yes_options, no_options = frozenset(["y"]), frozenset(["n"]) while True: From c33417aa427f4923ce584d6274042d619fe8a4c4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 28 Mar 2019 18:52:24 -0700 Subject: [PATCH 048/507] Update tox from 3.8.0 to 3.8.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 01e826cd..d0c1602d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.8.0 +tox==3.8.1 pytest==4.3.1 pytest-cookies==0.3.0 pyyaml==5.1 From 3b6f73afb252ca0e283696006faf06c0dac021ff Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 29 Mar 2019 11:00:31 +0000 Subject: [PATCH 049/507] Update sphinx from 1.8.5 to 2.0.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 0c6886f7..baac837c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.15.1 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb -Sphinx==1.8.5 # https://github.com/sphinx-doc/sphinx +Sphinx==2.0.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From da51b7a364e2ff8b509208e2e62e025ced443a5e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 29 Mar 2019 09:58:15 -0700 Subject: [PATCH 050/507] Update tox from 3.8.1 to 3.8.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d0c1602d..f5435958 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.8.1 +tox==3.8.3 pytest==4.3.1 pytest-cookies==0.3.0 pyyaml==5.1 From 1bc185d2f7289b481a56165a11bbe39c32d2f983 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 31 Mar 2019 12:00:28 +0100 Subject: [PATCH 051/507] Update sentry-sdk from 0.7.8 to 0.7.9 --- {{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 17b9d00c..035cefd7 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.7.4 --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.8 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.9 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 4e70a4b55a2d5efafdb9761719bafb1b6ece3154 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 1 Apr 2019 08:47:46 +0100 Subject: [PATCH 052/507] Test all possible template combinations (#1993) ## Description Fixes #591. ## Rationale We are currently not testing many combinations, we run Flake8 on the generated project with default options, but that rarely catch any issues. ## Use case(s) / visualization(s) Catch problems with invalid combinations, for instance, it fails due to Whitenoise breaking flake8 with `django-compressor` because `STATIC_URL` was undefined here: https://github.com/pydanny/cookiecutter-django/blob/b91c70d75578e56c2ca74400684c5b5523cd0cd4/%7B%7Bcookiecutter.project_slug%7D%7D/config/settings/production.py#L185 --- requirements.txt | 2 + tests/test_cookiecutter_generation.py | 76 +++++++++++++------ .../config/settings/base.py | 4 +- .../config/settings/production.py | 2 +- .../requirements/base.txt | 2 +- 5 files changed, 57 insertions(+), 29 deletions(-) diff --git a/requirements.txt b/requirements.txt index f5435958..a44e1fe4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,11 +4,13 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ +black==19.3b0 flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ tox==3.8.3 pytest==4.3.1 +pytest_cases==1.5.1 pytest-cookies==0.3.0 pyyaml==5.1 diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 3010d364..36395627 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -1,14 +1,17 @@ import os import re -import sh -import yaml import pytest +from pytest_cases import pytest_fixture_plus +import sh +import yaml from binaryornot.check import is_binary PATTERN = "{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) +YN_CHOICES = ["y", "n"] + @pytest.fixture def context(): @@ -24,6 +27,35 @@ def context(): } +@pytest_fixture_plus +@pytest.mark.parametrize("windows", YN_CHOICES, ids=lambda yn: f"win:{yn}") +@pytest.mark.parametrize("use_docker", YN_CHOICES, ids=lambda yn: f"docker:{yn}") +@pytest.mark.parametrize("use_celery", YN_CHOICES, ids=lambda yn: f"celery:{yn}") +@pytest.mark.parametrize("use_mailhog", YN_CHOICES, ids=lambda yn: f"mailhog:{yn}") +@pytest.mark.parametrize("use_sentry", YN_CHOICES, ids=lambda yn: f"sentry:{yn}") +@pytest.mark.parametrize("use_compressor", YN_CHOICES, ids=lambda yn: f"cmpr:{yn}") +@pytest.mark.parametrize("use_whitenoise", YN_CHOICES, ids=lambda yn: f"wnoise:{yn}") +def context_combination( + windows, + use_docker, + use_celery, + use_mailhog, + use_sentry, + use_compressor, + use_whitenoise, +): + """Fixture that parametrize the function where it's used.""" + return { + "windows": windows, + "use_docker": use_docker, + "use_compressor": use_compressor, + "use_celery": use_celery, + "use_mailhog": use_mailhog, + "use_sentry": use_sentry, + "use_whitenoise": use_whitenoise, + } + + def build_files_list(root_dir): """Build a list containing absolute paths to the generated files.""" return [ @@ -48,8 +80,13 @@ def check_paths(paths): assert match is None, msg.format(path) -def test_default_configuration(cookies, context): - result = cookies.bake(extra_context=context) +def test_project_generation(cookies, context, context_combination): + """ + Test that project is generated and fully rendered. + + This is parametrized for each combination from ``context_combination`` fixture + """ + result = cookies.bake(extra_context={**context, **context_combination}) assert result.exit_code == 0 assert result.exception is None assert result.project.basename == context["project_slug"] @@ -60,33 +97,24 @@ def test_default_configuration(cookies, context): check_paths(paths) -@pytest.fixture(params=["use_mailhog", "use_celery", "windows"]) -def feature_context(request, context): - context.update({request.param: "y"}) - return context +def test_linting_passes(cookies, context_combination): + """ + Generated project should pass flake8 & black. - -def test_enabled_features(cookies, feature_context): - result = cookies.bake(extra_context=feature_context) - assert result.exit_code == 0 - assert result.exception is None - assert result.project.basename == feature_context["project_slug"] - assert result.project.isdir() - - paths = build_files_list(str(result.project)) - assert paths - check_paths(paths) - - -def test_flake8_compliance(cookies): - """generated project should pass flake8""" - result = cookies.bake() + This is parametrized for each combination from ``context_combination`` fixture + """ + result = cookies.bake(extra_context=context_combination) try: sh.flake8(str(result.project)) except sh.ErrorReturnCode as e: pytest.fail(e) + try: + sh.black("--check", "--diff", "--exclude", "migrations", f"{result.project}/") + except sh.ErrorReturnCode as e: + pytest.fail(e) + def test_travis_invokes_pytest(cookies, context): context.update({"use_travisci": "y"}) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 848af8e8..f8d22377 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -43,9 +43,7 @@ USE_TZ = True DATABASES = {"default": env.db("DATABASE_URL")} {%- else %} DATABASES = { - "default": env.db( - "DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}" - ), + "default": env.db("DATABASE_URL", default="postgres://{% if cookiecutter.windows == 'y' %}localhost{% endif %}/{{cookiecutter.project_slug}}") } {%- endif %} DATABASES["default"]["ATOMIC_REQUESTS"] = True diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 546f2364..3db964b6 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -182,7 +182,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 +COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' %} # noqa F405{% endif %} {% endif %} {%- if cookiecutter.use_whitenoise == 'n' -%} # Collectfast diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index e0a76232..a1fa9b06 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -2,7 +2,7 @@ pytz==2018.9 # https://github.com/stub42/pytz python-slugify==3.0.1 # https://github.com/un33k/python-slugify Pillow==5.4.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} -rcssmin==1.0.6{% if cookiecutter.windows == 'y' and use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin +rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} From e55d76529be5133b8bdd10275c615a2f0de93dd7 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2019 00:47:56 -0700 Subject: [PATCH 053/507] Update pytest from 4.3.1 to 4.4.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a44e1fe4..85c7fd03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ tox==3.8.3 -pytest==4.3.1 +pytest==4.4.0 pytest_cases==1.5.1 pytest-cookies==0.3.0 pyyaml==5.1 From 22801fe30e579f3749aa546652a2207cbbc8693b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 1 Apr 2019 12:00:32 +0100 Subject: [PATCH 054/507] Update python-slugify from 3.0.1 to 3.0.2 --- {{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 a1fa9b06..f09448cc 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2018.9 # https://github.com/stub42/pytz -python-slugify==3.0.1 # https://github.com/un33k/python-slugify +python-slugify==3.0.2 # https://github.com/un33k/python-slugify Pillow==5.4.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From e10aafe802aa40067c199a924903adab05c62b79 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 1 Apr 2019 12:00:35 +0100 Subject: [PATCH 055/507] Update celery from 4.2.1 to 4.3.0 --- {{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 a1fa9b06..cb422dd9 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -10,7 +10,7 @@ whitenoise==4.1.2 # https://github.com/evansd/whitenoise {%- endif %} redis==3.2.1 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} -celery==4.2.1 # pyup: < 5.0 # https://github.com/celery/celery +celery==4.3.0 # pyup: < 5.0 # https://github.com/celery/celery kombu==4.4.0 # https://github.com/celery/kombu {%- if cookiecutter.use_docker == 'y' %} flower==0.9.3 # https://github.com/mher/flower From faf0e0bc7ef833cb4e3cc99f3c193a82ec4851fe Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 1 Apr 2019 12:00:43 +0100 Subject: [PATCH 056/507] Update pytest from 4.3.1 to 4.4.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 baac837c..028886b0 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.7.7 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.670 # https://github.com/python/mypy -pytest==4.3.1 # https://github.com/pytest-dev/pytest +pytest==4.4.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From b3680c8d723c704c05d5c58f49f954f214a9d78c Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 1 Apr 2019 12:59:05 +0100 Subject: [PATCH 057/507] Remove Kombu from direct dependencies --- {{cookiecutter.project_slug}}/requirements/base.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index cb422dd9..10f69c57 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,7 +11,6 @@ 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 -kombu==4.4.0 # https://github.com/celery/kombu {%- if cookiecutter.use_docker == 'y' %} flower==0.9.3 # https://github.com/mher/flower {%- endif %} From 96934ab3e4c31e48c810aea70b28c93c84abc9af Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 1 Apr 2019 20:07:42 -0700 Subject: [PATCH 058/507] Update tox from 3.8.3 to 3.8.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 85c7fd03..aebe0e54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.8.3 +tox==3.8.4 pytest==4.4.0 pytest_cases==1.5.1 pytest-cookies==0.3.0 From 6d48275e5fd66c412f097f05e7125b5e76b46052 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 10:33:38 +0100 Subject: [PATCH 059/507] Fix Heroku docs --- docs/deployment-on-heroku.rst | 5 ++++- tests/test_docker.sh | 16 ++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst index 8cc3a6b5..4a16123a 100644 --- a/docs/deployment-on-heroku.rst +++ b/docs/deployment-on-heroku.rst @@ -3,6 +3,9 @@ Deployment on Heroku .. index:: Heroku +Commands to run +--------------- + Run these commands to deploy the project to Heroku: .. code-block:: bash @@ -115,4 +118,4 @@ About Heroku & Docker Although Heroku has some sort of `Docker support`_, it's not supported by cookiecutter-django. We invite you to follow Heroku documentation about it. -.. _Docker support:: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml +.. _Docker support: https://devcenter.heroku.com/articles/build-docker-images-heroku-yml diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 55771c14..018ad85f 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -16,17 +16,9 @@ cd .cache/docker cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y $@ cd my_awesome_project -# run the project's type checks -docker-compose -f local.yml run django mypy my_awesome_project +# run migrations +docker-compose -f local.yml run django python manage.py migrate -# Run black with --check option -docker-compose -f local.yml run django black --check --diff --exclude 'migrations' ./ +# view backups +docker-compose -f local.yml exec postgres backups -# run the project's tests -docker-compose -f local.yml run django pytest - -# return non-zero status code if there are migrations that have not been created -docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } - -# Test support for translations -docker-compose -f local.yml run django python manage.py makemessages From edf2eba6af19af60befb9741d5c0223eb74834ef Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 10:36:42 +0100 Subject: [PATCH 060/507] Remove outdated warning in Local docker docs --- docs/developing-locally-docker.rst | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 10815419..da4e67aa 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -17,17 +17,6 @@ Prerequisites .. _`installation guide`: https://docs.docker.com/compose/install/ -Attention, Windows Users ------------------------- - -Currently PostgreSQL (``psycopg2`` python package) is not installed inside Docker containers for Windows users, while it is required by the generated Django project. To fix this, add ``psycopg2`` to the list of requirements inside ``requirements/base.txt``:: - - # Python-PostgreSQL Database Adapter - psycopg2==2.6.2 - -Doing this will prevent the project from being installed in an Windows-only environment (thus without usage of Docker). If you want to use this project without Docker, make sure to remove ``psycopg2`` from the requirements again. - - Build the Stack --------------- From fbce0c8ba14baa77a5d080f816a0902069b5f491 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 2 Apr 2019 12:00:29 +0100 Subject: [PATCH 061/507] Update pillow from 5.4.1 to 6.0.0 --- {{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 e9cade35..9d4aec7d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2018.9 # https://github.com/stub42/pytz python-slugify==3.0.2 # https://github.com/un33k/python-slugify -Pillow==5.4.1 # https://github.com/python-pillow/Pillow +Pillow==6.0.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} From 17e7d603cf8ccea58dfc8e29873abae5b2f4c26a Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:08:51 +0200 Subject: [PATCH 062/507] 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 3db964b6..3b61b470 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 063/507] Added myself to CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 154fa1ac..9486b3a0 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 064/507] 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 705add87..6e4b363c 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 8851ac13ef84d15f07d69ab107038956f79f5e9a Mon Sep 17 00:00:00 2001 From: Jelmert Date: Thu, 8 Nov 2018 11:14:58 +0100 Subject: [PATCH 065/507] Added the awscli container for uploading and downloading backups from and to Amazon S3 --- CONTRIBUTORS.rst | 2 ++ docs/docker-postgres-backups.rst | 8 +++++ .../compose/production/aws/Dockerfile | 9 ++++++ .../production/aws/maintenance/download | 24 +++++++++++++++ .../compose/production/aws/maintenance/upload | 30 +++++++++++++++++++ {{cookiecutter.project_slug}}/production.yml | 8 +++++ 6 files changed, 81 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/compose/production/aws/Dockerfile create mode 100644 {{cookiecutter.project_slug}}/compose/production/aws/maintenance/download create mode 100644 {{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 154fa1ac..9486b3a0 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 diff --git a/docs/docker-postgres-backups.rst b/docs/docker-postgres-backups.rst index c1a8a5e0..246ae403 100644 --- a/docs/docker-postgres-backups.rst +++ b/docs/docker-postgres-backups.rst @@ -85,3 +85,11 @@ You will see something like :: # ... ALTER TABLE SUCCESS: The 'my_project' database has been restored from the '/backups/backup_2018_03_13T09_05_07.sql.gz' backup. + + +Backup to Amazon S3 +---------------------------------- +For uploading your backups to Amazon S3 you can use the aws cli container. There is a upload command for uploading the postgres /backups directory recursively and there is a download command for downloading a specific backup. The default S3 environment variables are used. :: + + $ docker-compose -f production.yml run --rm awscli upload + $ docker-compose -f production.yml run --rm awscli download backup_2018_03_13T09_05_07.sql.gz diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile new file mode 100644 index 00000000..8282047b --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/aws/Dockerfile @@ -0,0 +1,9 @@ +FROM garland/aws-cli-docker:1.15.47 + +COPY ./compose/production/aws/maintenance /usr/local/bin/maintenance +COPY ./compose/production/postgres/maintenance/_sourced /usr/local/bin/maintenance/_sourced + +RUN chmod +x /usr/local/bin/maintenance/* + +RUN mv /usr/local/bin/maintenance/* /usr/local/bin \ + && rmdir /usr/local/bin/maintenance diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download new file mode 100644 index 00000000..8d5ea091 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/download @@ -0,0 +1,24 @@ +#!/bin/sh + +### Download a file from your Amazon S3 bucket to the postgres /backups folder +### +### Usage: +### $ docker-compose -f production.yml run --rm awscli <1> + +set -o errexit +set -o pipefail +set -o nounset + +working_dir="$(dirname ${0})" +source "${working_dir}/_sourced/constants.sh" +source "${working_dir}/_sourced/messages.sh" + +export AWS_ACCESS_KEY_ID="${DJANGO_AWS_ACCESS_KEY_ID}" +export AWS_SECRET_ACCESS_KEY="${DJANGO_AWS_SECRET_ACCESS_KEY}" +export AWS_STORAGE_BUCKET_NAME="${DJANGO_AWS_STORAGE_BUCKET_NAME}" + + +aws s3 cp s3://${AWS_STORAGE_BUCKET_NAME}${BACKUP_DIR_PATH}/${1} ${BACKUP_DIR_PATH}/${1} + +message_success "Finished downloading ${1}." + diff --git a/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload new file mode 100644 index 00000000..4a89dcb5 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/aws/maintenance/upload @@ -0,0 +1,30 @@ +#!/bin/sh + +### Upload the /backups folder to Amazon S3 +### +### Usage: +### $ docker-compose -f production.yml run --rm awscli upload + +set -o errexit +set -o pipefail +set -o nounset + +working_dir="$(dirname ${0})" +source "${working_dir}/_sourced/constants.sh" +source "${working_dir}/_sourced/messages.sh" + +export AWS_ACCESS_KEY_ID="${DJANGO_AWS_ACCESS_KEY_ID}" +export AWS_SECRET_ACCESS_KEY="${DJANGO_AWS_SECRET_ACCESS_KEY}" +export AWS_STORAGE_BUCKET_NAME="${DJANGO_AWS_STORAGE_BUCKET_NAME}" + + +message_info "Upload the backups directory to S3 bucket {$AWS_STORAGE_BUCKET_NAME}" + +aws s3 cp ${BACKUP_DIR_PATH} s3://${AWS_STORAGE_BUCKET_NAME}${BACKUP_DIR_PATH} --recursive + +message_info "Cleaning the directory ${BACKUP_DIR_PATH}" + +rm -rf ${BACKUP_DIR_PATH}/* + +message_success "Finished uploading and cleaning." + diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 88cf8773..a24ba829 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -65,3 +65,11 @@ services: command: /start-flower {%- endif %} + awscli: + build: + context: . + dockerfile: ./compose/production/aws/Dockerfile + env_file: + - ./.envs/.production/.django + volumes: + - production_postgres_data_backups:/backups From 27d806fab11734440cb97e987ea2886182fc3811 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Fri, 23 Nov 2018 11:19:54 +0100 Subject: [PATCH 066/507] Typo --- docs/docker-postgres-backups.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docker-postgres-backups.rst b/docs/docker-postgres-backups.rst index 246ae403..6ccb7cf1 100644 --- a/docs/docker-postgres-backups.rst +++ b/docs/docker-postgres-backups.rst @@ -89,7 +89,7 @@ You will see something like :: Backup to Amazon S3 ---------------------------------- -For uploading your backups to Amazon S3 you can use the aws cli container. There is a upload command for uploading the postgres /backups directory recursively and there is a download command for downloading a specific backup. The default S3 environment variables are used. :: +For uploading your backups to Amazon S3 you can use the aws cli container. There is an upload command for uploading the postgres /backups directory recursively and there is a download command for downloading a specific backup. The default S3 environment variables are used. :: $ docker-compose -f production.yml run --rm awscli upload $ docker-compose -f production.yml run --rm awscli download backup_2018_03_13T09_05_07.sql.gz From d1bf4f48152ec00c3fbdd45888e4963e302f36e4 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:43:48 +0200 Subject: [PATCH 067/507] Added AWS_S3_REGION_NAME to production settings --- {{cookiecutter.project_slug}}/config/settings/production.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 3db964b6..236c6c9f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -86,6 +86,8 @@ AWS_S3_OBJECT_PARAMETERS = { } # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings 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) # STATIC # ------------------------ From 7e23327fe2c705b6e858bd6fbbc7b40e3b2e2e74 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:45:58 +0200 Subject: [PATCH 068/507] Added DJANG_AWS_S3_REGION_NAME to settings docs --- docs/settings.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.rst b/docs/settings.rst index 705add87..212527cf 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -44,6 +44,7 @@ CELERY_BROKER_URL CELERY_BROKER_URL auto w/ Dock DJANGO_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID n/a raises error 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 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 From d8271fae21cd8a15e8ec40cdd8825eb4081d208f Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 2 Apr 2019 15:47:18 +0200 Subject: [PATCH 069/507] Added myself to CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 154fa1ac..9486b3a0 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 1d420157c10f0c25839e186b0c1b13f6eb35fe1f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 15:10:14 +0100 Subject: [PATCH 070/507] Revert accidental commit --- tests/test_docker.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 018ad85f..55771c14 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -16,9 +16,17 @@ cd .cache/docker cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y $@ cd my_awesome_project -# run migrations -docker-compose -f local.yml run django python manage.py migrate +# run the project's type checks +docker-compose -f local.yml run django mypy my_awesome_project -# view backups -docker-compose -f local.yml exec postgres backups +# Run black with --check option +docker-compose -f local.yml run django black --check --diff --exclude 'migrations' ./ +# run the project's tests +docker-compose -f local.yml run django pytest + +# return non-zero status code if there are migrations that have not been created +docker-compose -f local.yml run django python manage.py makemigrations --dry-run --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; } + +# Test support for translations +docker-compose -f local.yml run django python manage.py makemessages From 895298c28f77857743415ca8675a8c38f36bf153 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 2 Apr 2019 15:26:55 +0100 Subject: [PATCH 071/507] 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 ab05b375..292f6e7f 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 d9319f5c..5b8e9eaf 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 6ef3b63c..b8fdd0dd 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 4e2493f3..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 {{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 f0abae7e..be67050d 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 c8bc31d3..072c6ae6 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 def83076..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 {{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 f0abae7e..be67050d 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 10f0d20c..4e519c3f 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 e69de29b..480655af 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 00000000..e275f054 --- /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 f8d22377..b4d064fe 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 e69de29b..00000000 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 529da1ae..00000000 --- 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 00000000..c99341c5 --- /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 00000000..addb091d --- /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 072/507] 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 9d4aec7d..6c70c367 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 073/507] 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 f8d22377..026c88cf 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 074/507] 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 b5dda0c7..11e4456f 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 075/507] 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 2c037e51..00215092 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 a5483797..f9824a6d 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 6ef3b63c..b9dbf218 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 e7115fcee93b6d3d0f82a97bb9d97ab2fe28efc9 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 3 Apr 2019 12:00:30 +0100 Subject: [PATCH 076/507] Update werkzeug from 0.15.1 to 0.15.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 028886b0..01bb6d2f 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.1 # https://github.com/pallets/werkzeug +Werkzeug==0.15.2 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From 0aafad16dd5f7d93f02dee9cb268dee9fa8ce2b0 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 3 Apr 2019 10:24:10 -0700 Subject: [PATCH 077/507] Update tox from 3.8.4 to 3.8.6 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index aebe0e54..c38f0650 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ -tox==3.8.4 +tox==3.8.6 pytest==4.4.0 pytest_cases==1.5.1 pytest-cookies==0.3.0 From c80bcb8932856c405cb01862340a18ffe2a90d06 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 3 Apr 2019 10:24:15 -0700 Subject: [PATCH 078/507] Update pytest_cases from 1.5.1 to 1.6.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index aebe0e54..efeb48f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,6 +11,6 @@ flake8==3.7.6 # ------------------------------------------------------------------------------ tox==3.8.4 pytest==4.4.0 -pytest_cases==1.5.1 +pytest_cases==1.6.1 pytest-cookies==0.3.0 pyyaml==5.1 From ea749071c2b681b5b7a576eb62279d8c8c53f6dd Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 4 Apr 2019 12:00:30 +0100 Subject: [PATCH 079/507] Update psycopg2-binary from 2.7.7 to 2.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 01bb6d2f..05ddb714 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -6,7 +6,7 @@ Sphinx==2.0.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} -psycopg2-binary==2.7.7 # https://github.com/psycopg/psycopg2 +psycopg2-binary==2.8 # https://github.com/psycopg/psycopg2 {%- endif %} # Testing From 63f5ad028039da2ad52b659046e87f66de571686 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 4 Apr 2019 12:00:33 +0100 Subject: [PATCH 080/507] Update mypy from 0.670 to 0.700 --- {{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 01bb6d2f..7e1cc25a 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.7.7 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.670 # https://github.com/python/mypy +mypy==0.700 # https://github.com/python/mypy pytest==4.4.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From b9c5ca2b86dd5c347d8317fe59597a4a9d59aa15 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 4 Apr 2019 15:03:49 +0200 Subject: [PATCH 081/507] Also update psycopg2 no-binary --- {{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 05ddb714..2d7e3ba1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ Werkzeug==0.15.2 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb Sphinx==2.0.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} -psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} psycopg2-binary==2.8 # https://github.com/psycopg/psycopg2 {%- endif %} From b30b9795d2f142bd06bf8e431105cf97f68163bd Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 4 Apr 2019 15:04:57 +0200 Subject: [PATCH 082/507] Update psycopg2 to 2.8 in production --- {{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 035cefd7..5a40f07a 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.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==0.6.2 # https://github.com/antonagestam/collectfast {%- endif %} From cad0b7765878fdb2f8b19230d6ce9a52f3143c07 Mon Sep 17 00:00:00 2001 From: anuj Date: Tue, 2 Apr 2019 11:43:31 +0530 Subject: [PATCH 083/507] Added support for GCE Media storage --- cookiecutter.json | 4 ++++ .../.envs/.production/.django | 9 ++++++-- .../config/settings/production.py | 23 ++++++++++++------- .../requirements/production.txt | 4 ++++ 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index b5dda0c7..eabf7d14 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -32,6 +32,10 @@ "None", "Gulp" ], + "cloud_provider": [ + "AWS", + "GCE" + ], "custom_bootstrap_compilation": "n", "use_compressor": "n", "use_celery": "n", diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index 4175f894..a938ada6 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -16,13 +16,18 @@ DJANGO_SECURE_SSL_REDIRECT=False MAILGUN_API_KEY= DJANGO_SERVER_EMAIL= MAILGUN_DOMAIN= - +{% if cookiecutter.cloud_provider == 'AWS' %} # AWS # ------------------------------------------------------------------------------ DJANGO_AWS_ACCESS_KEY_ID= DJANGO_AWS_SECRET_ACCESS_KEY= DJANGO_AWS_STORAGE_BUCKET_NAME= - +{% elif cookiecutter.cloud_provider == 'GCE' %} +# GCE +# ------------------------------------------------------------------------------ +GOOGLE_APPLICATION_CREDENTIALS= +DJANGO_GCE_STORAGE_BUCKET_NAME= +{% endif %} # django-allauth # ------------------------------------------------------------------------------ DJANGO_ACCOUNT_ALLOW_REGISTRATION=True diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 236c6c9f..26fa6294 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -69,7 +69,8 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( # STORAGES # ------------------------------------------------------------------------------ # https://django-storages.readthedocs.io/en/latest/#installation -INSTALLED_APPS += ["storages"] # noqa F405 +INSTALLED_APPS += ['storages'] # noqa F405 +{% 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") # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings @@ -88,22 +89,25 @@ 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' %} +DEFAULT_FILE_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' +GS_BUCKET_NAME = env('DJANGO_GCE_STORAGE_BUCKET_NAME') +GS_DEFAULT_ACL = 'publicRead' +{% endif %} # STATIC # ------------------------ {% if cookiecutter.use_whitenoise == 'y' -%} STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" -{%- else %} -STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" -STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" +{%- endif -%} +{%- if cookiecutter.cloud_provider == 'AWS' %} +STATICFILES_STORAGE = 'config.settings.production.StaticRootS3Boto3Storage' +STATIC_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/' {%- endif %} # MEDIA # ------------------------------------------------------------------------------ -{% if cookiecutter.use_whitenoise == 'y' -%} -DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" -MEDIA_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/" -{%- else %} +{%- if cookiecutter.cloud_provider == 'AWS' %} # region http://stackoverflow.com/questions/10390244/ # Full-fledge class: https://stackoverflow.com/a/18046120/104731 from storages.backends.s3boto3 import S3Boto3Storage # noqa E402 @@ -121,6 +125,9 @@ 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' %} +MEDIA_URL = 'https://storage.googleapis.com/{}/'.format(GS_BUCKET_NAME) +MEDIA_ROOT = 'https://storage.googleapis.com/{}/'.format(GS_BUCKET_NAME) {%- endif %} # TEMPLATES diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 5a40f07a..b1758194 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -13,5 +13,9 @@ sentry-sdk==0.7.9 # https://github.com/getsentry/sentry-python # Django # ------------------------------------------------------------------------------ +{%- if cookiecutter.cloud_provider == 'AWS' %} 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 From 749920e81cd4e382b06cd1bcb32a17201fe44853 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 6 Apr 2019 13:00:29 +0200 Subject: [PATCH 084/507] Update pytest_cases from 1.6.1 to 1.6.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2b2c55f3..25b0135b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,6 +11,6 @@ flake8==3.7.6 # ------------------------------------------------------------------------------ tox==3.8.6 pytest==4.4.0 -pytest_cases==1.6.1 +pytest_cases==1.6.2 pytest-cookies==0.3.0 pyyaml==5.1 From c582ac48ec5bc61a849b3ceb6d5d4b6f0c854f7c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 6 Apr 2019 13:00:32 +0200 Subject: [PATCH 085/507] Update sentry-sdk from 0.7.9 to 0.7.10 --- {{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 5a40f07a..ea4b376f 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.9 # https://github.com/getsentry/sentry-python +sentry-sdk==0.7.10 # https://github.com/getsentry/sentry-python {%- endif %} # Django From b5e030b78439c1118d8e64c1ee582bcb6595059e Mon Sep 17 00:00:00 2001 From: anuj Date: Sun, 7 Apr 2019 00:34:22 +0530 Subject: [PATCH 086/507] Corrected quotes, added parameter in tests --- tests/test_cookiecutter_generation.py | 4 ++++ .../config/settings/production.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 36395627..17375b1c 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -11,6 +11,7 @@ PATTERN = "{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) YN_CHOICES = ["y", "n"] +CLOUD_CHOICES = ["AWS", "GCE"] @pytest.fixture @@ -35,6 +36,7 @@ def context(): @pytest.mark.parametrize("use_sentry", YN_CHOICES, ids=lambda yn: f"sentry:{yn}") @pytest.mark.parametrize("use_compressor", YN_CHOICES, ids=lambda yn: f"cmpr:{yn}") @pytest.mark.parametrize("use_whitenoise", YN_CHOICES, ids=lambda yn: f"wnoise:{yn}") +@pytest.mark.parametrize("cloud_provider", CLOUD_CHOICES, ids=lambda yn: f"cloud:{yn}") def context_combination( windows, use_docker, @@ -43,6 +45,7 @@ def context_combination( use_sentry, use_compressor, use_whitenoise, + cloud_provider, ): """Fixture that parametrize the function where it's used.""" return { @@ -53,6 +56,7 @@ def context_combination( "use_mailhog": use_mailhog, "use_sentry": use_sentry, "use_whitenoise": use_whitenoise, + "cloud_provider": cloud_provider, } diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 26fa6294..61f90104 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -69,7 +69,7 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( # STORAGES # ------------------------------------------------------------------------------ # https://django-storages.readthedocs.io/en/latest/#installation -INSTALLED_APPS += ['storages'] # noqa F405 +INSTALLED_APPS += ["storages"] # noqa F405 {% 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") @@ -90,9 +90,9 @@ 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' %} -DEFAULT_FILE_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage' -GS_BUCKET_NAME = env('DJANGO_GCE_STORAGE_BUCKET_NAME') -GS_DEFAULT_ACL = 'publicRead' +DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" +GS_BUCKET_NAME = env("DJANGO_GCE_STORAGE_BUCKET_NAME") +GS_DEFAULT_ACL = "publicRead" {% endif %} # STATIC @@ -101,8 +101,8 @@ GS_DEFAULT_ACL = 'publicRead' STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {%- endif -%} {%- if cookiecutter.cloud_provider == 'AWS' %} -STATICFILES_STORAGE = 'config.settings.production.StaticRootS3Boto3Storage' -STATIC_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/' +STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" +STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {%- endif %} # MEDIA @@ -126,8 +126,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/{}/'.format(GS_BUCKET_NAME) -MEDIA_ROOT = 'https://storage.googleapis.com/{}/'.format(GS_BUCKET_NAME) +MEDIA_URL = "https://storage.googleapis.com/{}/".format(GS_BUCKET_NAME) +MEDIA_ROOT = "https://storage.googleapis.com/{}/".format(GS_BUCKET_NAME) {%- endif %} # TEMPLATES From 2b141e646434396dbb40a2accd224c42dc105ce3 Mon Sep 17 00:00:00 2001 From: anuj Date: Sun, 7 Apr 2019 00:54:46 +0530 Subject: [PATCH 087/507] Add support for GCE static --- {{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 61f90104..4adbdb9c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -103,6 +103,8 @@ STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {%- if 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' %} +STATIC_URL = "https://storage.googleapis.com/{}/static".format(GS_BUCKET_NAME) {%- endif %} # MEDIA @@ -126,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/{}/".format(GS_BUCKET_NAME) -MEDIA_ROOT = "https://storage.googleapis.com/{}/".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 020933d336c09a7946edd69c92c2562f085c2ff2 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 9 Apr 2019 13:00:39 +0200 Subject: [PATCH 088/507] Update sphinx from 2.0.0 to 2.0.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 eb81e7d0..1c90cd84 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.15.2 # https://github.com/pallets/werkzeug ipdb==0.12 # https://github.com/gotcha/ipdb -Sphinx==2.0.0 # https://github.com/sphinx-doc/sphinx +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 %} From 6d906721fc74593c56b70a10ad9804c5ea6afb32 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 10 Apr 2019 13:00:32 +0200 Subject: [PATCH 089/507] Update pytz from 2018.9 to 2019.1 --- {{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 9d4aec7d..39bec2d4 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -pytz==2018.9 # https://github.com/stub42/pytz +pytz==2019.1 # https://github.com/stub42/pytz python-slugify==3.0.2 # https://github.com/un33k/python-slugify Pillow==6.0.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} From 56aa332e0146ef94306ebac3f0fdacbd64fcb4fc Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 14 Apr 2019 11:43:05 -0500 Subject: [PATCH 090/507] Documented Google Cloud Storage integration as an alternative to AWS S3 --- README.rst | 8 ++++++-- docs/project-generation-options.rst | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2c037e51..fccbdaf9 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ Features * Comes with custom user model ready to go * Optional custom static build using Gulp and livereload * Send emails via Anymail_ (using Mailgun_ by default, but switchable) -* Media storage using Amazon S3 +* Media storage using Amazon S3 or Google Cloud Storage * Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support) * Procfile_ for deploying to Heroku * Instructions for deploying to PythonAnywhere_ @@ -62,7 +62,7 @@ Optional Integrations *These features can be enabled during initial project setup.* -* Serve static files from Amazon S3 or Whitenoise_ +* Serve static files from Amazon S3, Google Cloud Storage or Whitenoise_ * Configuration for Celery_ and Flower_ (the latter in Docker setup only) * Integration with MailHog_ for local email testing * Integration with Sentry_ for error logging @@ -181,6 +181,10 @@ Answer the prompts with your own desired options_. For example:: 1 - None 2 - Gulp Choose from 1, 2 [1]: 1 + Select cloud_provider: + 1 - AWS + 2 - GCS + Choose from 1, 2 [1]: 1 custom_bootstrap_compilation [n]: n Select open_source_license: 1 - MIT diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index a5483797..82e9edc0 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -63,6 +63,12 @@ js_task_runner: 1. None 2. Gulp_ +cloud_provider: + Select a cloud provider for static files. The choices are: + + 1. AWS_ + 2. GCS_ + custom_bootstrap_compilation: Indicates whether the project should support Bootstrap recompilation via the selected JavaScript task runner's task. This can be useful From 7c8a473460f6c90a9773357aaec955b4591f5f65 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 14 Apr 2019 11:57:48 -0500 Subject: [PATCH 091/507] Updated settings.rst to reflect new GS env variable --- docs/settings.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.rst b/docs/settings.rst index 212527cf..dd698a0d 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -45,6 +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 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 From c041453bef94930c658edffe3f009b799d459a7d Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 14 Apr 2019 12:07:37 -0500 Subject: [PATCH 092/507] Updated project-generation-options.rst to provide helpful links in case a user needs to decide between AWS s3 and GCS and added myself to contributors.rst --- CONTRIBUTORS.rst | 2 ++ docs/project-generation-options.rst | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 9486b3a0..ded1606b 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -177,6 +177,7 @@ Listed in alphabetical order. Travis McNeill `@Travistock`_ @tavistock_esq Tubo Shi `@Tubo`_ Umair Ashraf `@umrashrf`_ @fabumair + Vlad Doster `@vladdoster`_ Vitaly Babiy Vivian Guillen `@viviangb`_ Will Farley `@goldhand`_ @g01dhand @@ -315,6 +316,7 @@ Listed in alphabetical order. .. _@mrcoles: https://github.com/mrcoles .. _@ericgroom: https://github.com/ericgroom .. _@hanaquadara: https://github.com/hanaquadara +.. _@vladdoster: https://github.com/vladdoster Special Thanks ~~~~~~~~~~~~~~ diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 82e9edc0..470ef949 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -121,6 +121,9 @@ debug: .. _Gulp: https://github.com/gulpjs/gulp +.. _AWS: https://aws.amazon.com/s3/ +.. _GCS: https://cloud.google.com/storage/ + .. _Django Compressor: https://github.com/django-compressor/django-compressor .. _Celery: https://github.com/celery/celery From 9137bb561fc1a7fbe83a6ca61e5c0fffe0c10146 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 16 Apr 2019 12:00:29 +0100 Subject: [PATCH 093/507] Update pytest from 4.4.0 to 4.4.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 25b0135b..cfd0c847 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.6 # Testing # ------------------------------------------------------------------------------ tox==3.8.6 -pytest==4.4.0 +pytest==4.4.1 pytest_cases==1.6.2 pytest-cookies==0.3.0 pyyaml==5.1 From 026dd6ed575d53d2af49b0878b8080b793c388c0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 16 Apr 2019 12:00:30 +0100 Subject: [PATCH 094/507] Update pytest from 4.4.0 to 4.4.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 1c90cd84..60c68dd1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.700 # https://github.com/python/mypy -pytest==4.4.0 # https://github.com/pytest-dev/pytest +pytest==4.4.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From f6cac35b8743407b788ea98b8b2c0444ed25df04 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 16 Apr 2019 11:23:41 -0500 Subject: [PATCH 095/507] Update docs/project-generation-options.rst Clearer diction describing cloud provider roles Co-Authored-By: vladdoster --- docs/project-generation-options.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index 470ef949..c9b3dff8 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -64,7 +64,7 @@ js_task_runner: 2. Gulp_ cloud_provider: - Select a cloud provider for static files. The choices are: + Select a cloud provider for static & media files. The choices are: 1. AWS_ 2. GCS_ From cd13ab4c823e3c9619c9deac5ca368b9af477a9a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 16 Apr 2019 11:30:22 -0500 Subject: [PATCH 096/507] Update docs/settings.rst Documented GOOGLE_APPLICATION_CREDENTIALS env var Co-Authored-By: vladdoster --- docs/settings.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/settings.rst b/docs/settings.rst index dd698a0d..1830a47c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -46,6 +46,7 @@ DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a 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 +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 From 6f2a652c2b5be918a67294522e7fdeb04924b539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Tue, 16 Apr 2019 19:42:57 -0300 Subject: [PATCH 097/507] update PostgreSQL versions in the example --- README.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index fccbdaf9..5a0fc5fb 100644 --- a/README.rst +++ b/README.rst @@ -169,13 +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 + 1 - 10.5 + 2 - 10.4 + 3 - 10.3 + 4 - 10.2 + 5 - 10.1 + 6 - 9.6 + 7 - 9.5 + 8 - 9.4 + 9 - 9.3 Choose from 1, 2, 3, 4 [1]: 1 Select js_task_runner: 1 - None From 4d8e3c8c137a9bd2e54a4a408d27ee0e65e9f57e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Tue, 16 Apr 2019 20:24:05 -0300 Subject: [PATCH 098/507] update "description" in the example --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5a0fc5fb..91fbe3ef 100644 --- a/README.rst +++ b/README.rst @@ -155,7 +155,7 @@ Answer the prompts with your own desired options_. For example:: project_slug [reddit_clone]: reddit author_name [Daniel Roy Greenfeld]: Daniel Greenfeld email [you@example.com]: pydanny@gmail.com - description [A short description of the project.]: A reddit clone. + description [Behold My Awesome Project!]: A reddit clone. domain_name [example.com]: myreddit.com version [0.1.0]: 0.0.1 timezone [UTC]: America/Los_Angeles From 93d5426cb4cf63122364fd52da97296d40d9d78a Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 17 Apr 2019 08:37:45 +0100 Subject: [PATCH 099/507] Small updates in the READMEs --- README.rst | 6 +++--- {{cookiecutter.project_slug}}/README.rst | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 91fbe3ef..9e76d802 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ Features * For Django 2.0 * 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 @@ -51,7 +51,7 @@ Features * Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support) * Procfile_ for deploying to Heroku * Instructions for deploying to PythonAnywhere_ -* Run tests with unittest or py.test +* Run tests with unittest or pytest * Customizable PostgreSQL version .. _`maintained Foundation fork`: https://github.com/Parbhat/cookiecutter-django-foundation @@ -90,7 +90,7 @@ 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). +* Environment variables for configuration (This won't work with Apache/mod_wsgi). Support this Project! ---------------------- diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 6ef3b63c..b9dbf218 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 100/507] 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 60c68dd1..a2f72eda 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 101/507] 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 60c68dd1..d0e909e5 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 102/507] 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 cfd0c847..ea10eaa5 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 103/507] 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 bd2d58ad..5d85b6ff 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 104/507] 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 d9fa2550..c430e436 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 105/507] 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 c430e436..21e4cc8d 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 106/507] 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 5d85b6ff..85f60a4a 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 107/507] 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 21e4cc8d..4ae99be3 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 108/507] 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 39bec2d4..a6031c88 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 109/507] Add to contributors. --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index ded1606b..41bf6f65 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 110/507] 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 4adbdb9c..63225bee 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 111/507] Added link in contributors. --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 41bf6f65..6fa9e1c0 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 112/507] 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 85f60a4a..7095af3d 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 113/507] 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 ea10eaa5..3644de16 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 114/507] 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 7095af3d..3ef434e9 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 115/507] 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 854665fd..ded2072f 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 116/507] 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 dc54eb33..29e7f2b9 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 117/507] 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 3644de16..9391b0c6 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 118/507] 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 3ef434e9..1f8ab08d 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 119/507] 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 3ef434e9..8f26f0e6 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 120/507] 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 304732b9..0e59b3b4 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 121/507] 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 68db2fb0..b6a93ffc 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 122/507] 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 9391b0c6..42dd9ee6 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 123/507] 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 6327cf8c..5fc26c15 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 124/507] 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 a74090b2..f16c6582 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 42dd9ee6..121ba87f 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 17375b1c..2be23b86 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 cef3efc7..8306ccf2 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 125/507] 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 026c88cf..734c1c80 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 63225bee..61fb38d6 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 126/507] 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 121ba87f..608cd6b5 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 127/507] 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 026c88cf..3d51729f 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 ded2072f..2241e5eb 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 128/507] 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 6fa9e1c0..af974d5e 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 129/507] 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 608cd6b5..53d14378 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 130/507] Add recent changes to changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e59b3b4..e4eadd22 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 131/507] Add missing link in CONTRIBUTORS (#2058) --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index af974d5e..d11f9905 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 132/507] 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 01881b36..22a08b5a 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 133/507] 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 22a08b5a..0e0d9616 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 134/507] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4eadd22..89e5d015 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 135/507] 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 8a92edda..3434e09d 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 65bcd8fc..46c84b71 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 29e7f2b9..ddd8f041 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 136/507] 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 20bd3dba..c6361920 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 2502a0c0..eff24dd0 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 35e26e94..a2442741 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 137/507] 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 53d14378..02caf6eb 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 138/507] 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 4ae99be3..67c44c8f 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 139/507] 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 5fc26c15..ddab6ab1 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 140/507] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e5d015..449ce643 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 141/507] 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 c6dd654e..60f8f922 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 a24ba829..331cbba6 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 142/507] 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 61fb38d6..6b79b0af 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 143/507] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 449ce643..51ad4472 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 144/507] 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 d11f9905..bd748062 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 ad1f20e9..0f2abe8a 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 145/507] 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 6b79b0af..0c94b2d8 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 146/507] 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 ddab6ab1..24cedfda 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 147/507] 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 0c94b2d8..203612ca 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 148/507] 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 203612ca..1a5889d5 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 149/507] 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 8a92edda..efcfd506 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 a66bb732..d4a977bb 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 c3c4d3a2..3e4ac47c 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 292f6e7f..ff84f180 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 2be23b86..be05e79b 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 1a5889d5..c2fcd575 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 150/507] 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 67c44c8f..e62eeb73 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 151/507] 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 bd748062..7a9dbf79 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 8a92edda..d6372de6 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 a66bb732..cfb20f6b 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 c3c4d3a2..6f2a2f22 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 152/507] 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 1a5889d5..a132b3b2 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 153/507] 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 aad54932..e69abc01 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 154/507] 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 24cedfda..57a262c9 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 155/507] 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 a132b3b2..85b17f1b 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 156/507] 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 e69abc01..038778cf 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 157/507] 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 57a262c9..7f856f28 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 158/507] 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 02caf6eb..4a6b4b59 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 159/507] 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 7f856f28..2e2228c3 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 160/507] 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 e62eeb73..43b20513 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 161/507] 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 b72b7f00..4a522fdd 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 162/507] 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 d9771e59..476e0dff 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 163/507] 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 476e0dff..6fd0eac9 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 164/507] Add custom markers to pytest config --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index c5b30199..01c7b1bf 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 165/507] 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 6fd0eac9..1dbd2880 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 166/507] 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 be05e79b..4292f989 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 167/507] 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 65bcd8fc..e46cdb88 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 168/507] 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 e3ddae9a..469aa12d 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 169/507] Update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51ad4472..f013aec9 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 170/507] 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 1830a47c..0234ac85 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 171/507] 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 48a60dbc..42368690 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 172/507] 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 f16c6582..1be0b743 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 173/507] 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 7468981c..30a3a2db 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 15e0aac6..d6d217ca 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 42368690..afa9b8af 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 0234ac85..d0edce31 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 a938ada6..2c2e94f2 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 1dbd2880..2c7b7a12 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 43b20513..e8636fb8 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 174/507] 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 4a6b4b59..5089594c 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 175/507] 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 da4e67aa..562dc439 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 b6a93ffc..baabd494 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 176/507] 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 562dc439..09e68498 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 baabd494..8aa1b1f9 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 87b6180142d90aca51748600aaf8415e0d331107 Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Thu, 30 May 2019 03:28:57 -0700 Subject: [PATCH 177/507] 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 178/507] 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 179/507] 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 180/507] 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 f8d2eb11a958823689f8f6aac4590ae1b4edaf4f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 31 May 2019 10:02:42 +0100 Subject: [PATCH 181/507] 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 01c7b1bf..89aeb302 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 8306ccf2..7ee93915 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 e9e79428d3789622b31522ef0810147c6aa645be Mon Sep 17 00:00:00 2001 From: Keyvan Mosharraf Date: Fri, 31 May 2019 03:45:59 -0700 Subject: [PATCH 182/507] 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 3e7b60c8937ce8940f3ea135daf37c80c64f170e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 31 May 2019 12:00:33 +0100 Subject: [PATCH 183/507] 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 ddd8f041..88331996 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 184/507] 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 5089594c..d6049ecb 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 185/507] 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 2e2228c3..e08cfc97 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 186/507] 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 e8636fb8..2d76c011 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 From d7699315774ed79e68ef51610561e65d80662216 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 3 Jun 2019 12:01:41 +0100 Subject: [PATCH 187/507] Update sentry-sdk from 0.8.1 to 0.9.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 2d76c011..8cf1f1c4 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.1 # https://github.com/getsentry/sentry-python +sentry-sdk==0.9.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 78ec608f14f6cdab845076ed3a7ac14cd7cffe22 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 3 Jun 2019 12:01:44 +0100 Subject: [PATCH 188/507] Update django from 2.2.1 to 2.2.2 --- {{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 88331996..00845cc2 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.2.1 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.2 # 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 53f6e07dd5329a38119af303b7ffd8a1af8df1be Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 3 Jun 2019 12:01:48 +0100 Subject: [PATCH 189/507] Update sphinx from 2.0.1 to 2.1.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 e08cfc97..c5cd6d9f 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.0.1 # https://github.com/sphinx-doc/sphinx +Sphinx==2.1.0 # 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 32e683f637510d5e416acf0efc5c0476271a108f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 3 Jun 2019 13:45:32 -0700 Subject: [PATCH 190/507] 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 191/507] 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 192/507] 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 193/507] 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 194/507] 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 195/507] 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 196/507] 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 197/507] 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 198/507] 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 199/507] 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 200/507] 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 201/507] 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 202/507] 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 203/507] 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 204/507] 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 205/507] 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 206/507] 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 207/507] 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 208/507] 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 209/507] 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 210/507] 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 211/507] 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 @@ - - - - From 7166b92bf0cdf4d0d391f69a07b9aaa322fc1e4d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 17 Jun 2019 11:03:35 -0400 Subject: [PATCH 213/507] Update pytest_cases from 1.7.0 to 1.9.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f5c234c4..0db0861c 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.7.0 +pytest_cases==1.9.0 pytest-cookies==0.3.0 pytest-xdist==1.29.0 pyyaml==5.1.1 From dd32fb2c1390cd4108e43d06feaa2c6dbd6c7828 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 18 Jun 2019 20:50:17 +0100 Subject: [PATCH 214/507] Tweak formatting in docs --- docs/developing-locally.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index 3434f68b..8694dde7 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -120,12 +120,12 @@ In production, we have Mailgun_ configured to have your back! Celery ------ + If the project is configured to use Celery as a task scheduler then by default tasks are set to run on the main thread -when developing locally. If you have the appropriate setup on your local machine then set +when developing locally. If you have the appropriate setup on your local machine then set the following +in ``config/settings/local.py``:: -CELERY_TASK_ALWAYS_EAGER = False - -in /config/settings/local.py + CELERY_TASK_ALWAYS_EAGER = False Sass Compilation & Live Reloading From aaf5d8d8f5381b82454c5420051d14f9b6c34a0f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 18 Jun 2019 20:31:47 +0100 Subject: [PATCH 215/507] Run tests on bare metal Install with Celery and compressor as it requires compilation closes #1677 --- .travis.yml | 7 +++++++ tests/test_bare.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 tests/test_bare.sh diff --git a/.travis.yml b/.travis.yml index 1be0b743..c2bcdf42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,13 @@ matrix: script: sh tests/test_docker.sh - name: Docker with Celery script: sh tests/test_docker.sh use_celery=y + - name: Bare metal + script: sh tests/test_bare.sh use_celery=y use_compressor=y + services: + - postgresql + - redis-server + env: + - CELERY_BROKER_URL=redis://localhost:6379/0 install: - pip install tox diff --git a/tests/test_bare.sh b/tests/test_bare.sh new file mode 100755 index 00000000..7021a7e4 --- /dev/null +++ b/tests/test_bare.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# this is a very simple script that tests the docker configuration for cookiecutter-django +# it is meant to be run from the root directory of the repository, eg: +# sh tests/test_docker.sh + +set -o errexit + +# install test requirements +pip install -r requirements.txt + +# create a cache directory +mkdir -p .cache/bare +cd .cache/bare + +# create the project using the default settings in cookiecutter.json +cookiecutter ../../ --no-input --overwrite-if-exists use_docker=n $@ +cd my_awesome_project + +# Install OS deps +sudo utility/install_os_dependencies.sh install + +# Install Python deps +pip install -r requirements/local.txt + +# run the project's tests +pytest From 9b48f922edccadb54b1a08a95a748b3c48805470 Mon Sep 17 00:00:00 2001 From: Tim Claessens Date: Wed, 19 Jun 2019 09:46:10 +0200 Subject: [PATCH 216/507] Remove all end-of-line carriage returns and not just the first occurrence --- .../compose/local/django/Dockerfile | 10 +++++----- .../compose/production/django/Dockerfile | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index e2e9e5f3..67937822 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -20,23 +20,23 @@ COPY ./requirements /requirements RUN pip install -r /requirements/local.txt COPY ./compose/production/django/entrypoint /entrypoint -RUN sed -i 's/\r//' /entrypoint +RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint COPY ./compose/local/django/start /start -RUN sed -i 's/\r//' /start +RUN sed -i 's/\r$//g' /start RUN chmod +x /start {% if cookiecutter.use_celery == "y" %} COPY ./compose/local/django/celery/worker/start /start-celeryworker -RUN sed -i 's/\r//' /start-celeryworker +RUN sed -i 's/\r$//g' /start-celeryworker RUN chmod +x /start-celeryworker COPY ./compose/local/django/celery/beat/start /start-celerybeat -RUN sed -i 's/\r//' /start-celerybeat +RUN sed -i 's/\r$//g' /start-celerybeat RUN chmod +x /start-celerybeat COPY ./compose/local/django/celery/flower/start /start-flower -RUN sed -i 's/\r//' /start-flower +RUN sed -i 's/\r$//g' /start-flower RUN chmod +x /start-flower {% endif %} WORKDIR /app diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 80b5bc2c..37f66ec7 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -31,28 +31,28 @@ RUN pip install --no-cache-dir -r /requirements/production.txt \ && rm -rf /requirements COPY ./compose/production/django/entrypoint /entrypoint -RUN sed -i 's/\r//' /entrypoint +RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint RUN chown django /entrypoint COPY ./compose/production/django/start /start -RUN sed -i 's/\r//' /start +RUN sed -i 's/\r$//g' /start RUN chmod +x /start RUN chown django /start {%- if cookiecutter.use_celery == "y" %} COPY ./compose/production/django/celery/worker/start /start-celeryworker -RUN sed -i 's/\r//' /start-celeryworker +RUN sed -i 's/\r$//g' /start-celeryworker RUN chmod +x /start-celeryworker RUN chown django /start-celeryworker COPY ./compose/production/django/celery/beat/start /start-celerybeat -RUN sed -i 's/\r//' /start-celerybeat +RUN sed -i 's/\r$//g' /start-celerybeat RUN chmod +x /start-celerybeat RUN chown django /start-celerybeat COPY ./compose/production/django/celery/flower/start /start-flower -RUN sed -i 's/\r//' /start-flower +RUN sed -i 's/\r$//g' /start-flower RUN chmod +x /start-flower {%- endif %} From 13868c42c865d8c3e7a8d8499a47ed47fa795a93 Mon Sep 17 00:00:00 2001 From: Tim Claessens Date: Tue, 18 Jun 2019 11:57:55 +0200 Subject: [PATCH 217/507] Add name to contributors --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 275b707f..2c812f4f 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -180,6 +180,7 @@ Listed in alphabetical order. Tano Abeleyra `@tanoabeleyra`_ Taylor Baldwin Théo Segonds `@show0k`_ + Tim Claessens `@timclaessens` Tim Freund `@timfreund`_ Tom Atkins `@knitatoms`_ Tom Offermann @@ -292,6 +293,7 @@ Listed in alphabetical order. .. _@stepmr: https://github.com/stepmr .. _@suledev: https://github.com/suledev .. _@takkaria: https://github.com/takkaria +.. _@timclaessens: https://github.com/timclaessens .. _@timfreund: https://github.com/timfreund .. _@Travistock: https://github.com/Tavistock .. _@trungdong: https://github.com/trungdong From b1135ccb255c24fdd6df59721a8c4a07c41eb66b Mon Sep 17 00:00:00 2001 From: Tim Claessens Date: Wed, 19 Jun 2019 14:23:51 +0200 Subject: [PATCH 218/507] Sorting the names (firstname, lastname) --- CONTRIBUTORS.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 2c812f4f..9d09d308 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -65,8 +65,8 @@ Listed in alphabetical order. Ashley Camba Barclay Gauld `@yunti`_ Bartek `@btknu`_ - Ben Warren `@bwarren2`_ Ben Lopatin + Ben Warren `@bwarren2`_ Benjamin Abel Bert de Miranda `@bertdemiranda`_ Bo Lopker `@blopker`_ @@ -98,8 +98,8 @@ Listed in alphabetical order. Demetris Stavrou `@demestav`_ Denis Bobrov `@delneg`_ Denis Orehovsky `@apirobot`_ - Dónal Adams `@epileptic-fish`_ Diane Chen `@purplediane`_ @purplediane88 + Dónal Adams `@epileptic-fish`_ Dong Huynh `@trungdong`_ Emanuel Calso `@bloodpet`_ @bloodpet Eraldo Energy `@eraldo`_ @@ -133,8 +133,8 @@ Listed in alphabetical order. Keyvan Mosharraf `@keyvanm`_ Krzysztof Szumny `@noisy`_ Krzysztof Żuraw `@krzysztofzuraw`_ - Leonardo Jimenez `@xpostudio4`_ Leo Zhou `@glasslion`_ + Leonardo Jimenez `@xpostudio4`_ Lin Xianyi `@iynaix`_ Luis Nell `@originell`_ Lukas Klein From 07f9256a8b4e67211c32e81efb78aecf4c262fa2 Mon Sep 17 00:00:00 2001 From: Tim Claessens Date: Wed, 19 Jun 2019 14:24:31 +0200 Subject: [PATCH 219/507] Sorting the links --- CONTRIBUTORS.rst | 72 ++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 9d09d308..a580400c 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -201,22 +201,30 @@ Listed in alphabetical order. .. _@ad-m: https://github.com/ad-m .. _@adammsteele: https://github.com/adammsteele .. _@aeikenberry: https://github.com/aeikenberry +.. _@afrowave: https://github.com/afrowave +.. _@ahhda: https://github.com/ahhda .. _@alb3rto: https://github.com/alb3rto .. _@ameistad: https://github.com/ameistad .. _@amjith: https://github.com/amjith .. _@andor-pierdelacabeza: https://github.com/andor-pierdelacabeza +.. _@andresgz: https://github.com/andresgz .. _@antoniablair: https://github.com/antoniablair .. _@apirobot: https://github.com/apirobot .. _@archinal: https://github.com/archinal .. _@areski: https://github.com/areski .. _@arruda: https://github.com/arruda +.. _@bertdemiranda: https://github.com/bertdemiranda .. _@bittner: https://github.com/bittner .. _@bloodpet: https://github.com/bloodpet .. _@blopker: https://github.com/blopker .. _@bogdal: https://github.com/bogdal +.. _@brentpayne: https://github.com/brentpayne +.. _@btknu: https://github.com/btknu .. _@burhan: https://github.com/burhan +.. _@bwarren2: https://github.com/bwarren2 .. _@c-rhodes: https://github.com/c-rhodes .. _@caffodian: https://github.com/caffodian +.. _@canonnervio: https://github.com/canonnervio .. _@carlmjohnson: https://github.com/carlmjohnson .. _@catherinedevlin: https://github.com/catherinedevlin .. _@ccurvey: https://github.com/ccurvey @@ -226,113 +234,105 @@ Listed in alphabetical order. .. _@ChrisPappalardo: https://github.com/ChrisPappalardo .. _@chuckus: https://github.com/chuckus .. _@cmackenzie1: https://github.com/cmackenzie1 +.. _@cmargieson: https://github.com/cmargieson .. _@Collederas: https://github.com/Collederas .. _@curtisstpierre: https://github.com/curtisstpierre +.. _@dadokkio: https://github.com/dadokkio .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto +.. _@delneg: https://github.com/delneg .. _@demestav: https://github.com/demestav .. _@dezoito: https://github.com/dezoito .. _@dhepper: https://github.com/dhepper .. _@dot2dotseurat: https://github.com/dot2dotseurat .. _@dsclementsen: https://github.com/dsclementsen .. _@durkode: https://github.com/durkode +.. _@Egregors: https://github.com/Egregors .. _@epileptic-fish: https://gihub.com/epileptic-fish .. _@eraldo: https://github.com/eraldo .. _@erfaan: https://github.com/erfaan +.. _@ericgroom: https://github.com/ericgroom .. _@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 .. _@glasslion: https://github.com/glasslion +.. _@goldhand: https://github.com/goldhand .. _@hackebrot: https://github.com/hackebrot .. _@hairychris: https://github.com/hairychris +.. _@hanaquadara: https://github.com/hanaquadara .. _@hendrikschneider: https://github.com/hendrikschneider .. _@hjwp: https://github.com/hjwp .. _@IanLee1521: https://github.com/IanLee1521 .. _@ikkebr: https://github.com/ikkebr .. _@iynaix: https://github.com/iynaix +.. _@jangeador: https://github.com/jangeador .. _@jazztpt: https://github.com/jazztpt +.. _@jcass77: https://github.com/jcass77 .. _@jleclanche: https://github.com/jleclanche .. _@juliocc: https://github.com/juliocc .. _@jvanbrug: https://github.com/jvanbrug .. _@ka7eh: https://github.com/ka7eh .. _@kaidokert: https://github.com/kaidokert .. _@kappataumu: https://github.com/kappataumu +.. _@keithjeb: https://github.com/keithjeb .. _@kevgathuku: https://github.com/kevgathuku +.. _@keyvanm: https://github.com/keyvanm .. _@knitatoms: https://github.com/knitatoms .. _@krzysztofzuraw: https://github.com/krzysztofzuraw -.. _@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 +.. _@MightySCollins: https://github.com/MightySCollins .. _@mimischi: https://github.com/mimischi .. _@minho42: https://github.com/minho42 .. _@mjsisley: https://github.com/mjsisley -.. _@myilmaz: https://github.com/myilmaz +.. _@mknapper1: https://github.com/mknapper1 +.. _@mostaszewski: https://github.com/mostaszewski .. _@mozillazg: https://github.com/mozillazg +.. _@mrcoles: https://github.com/mrcoles +.. _@msaizar: https://github.com/msaizar +.. _@myilmaz: https://github.com/myilmaz .. _@noisy: https://github.com/noisy .. _@originell: https://github.com/originell .. _@oubiga: https://github.com/oubiga .. _@parbhat: https://github.com/parbhat +.. _@pchiquet: https://github.com/pchiquet +.. _@phiberjenz: https://github.com/phiberjenz +.. _@purplediane: https://github.com/purplediane .. _@raonyguimaraes: https://github.com/raonyguimaraes .. _@reggieriser: https://github.com/reggieriser .. _@rm--: https://github.com/rm-- +.. _@rolep: https://github.com/rolep .. _@romanosipenko: https://github.com/romanosipenko +.. _@saschalalala: https://github.com/saschalalala .. _@shireenrao: https://github.com/shireenrao .. _@show0k: https://github.com/show0k .. _@shultz: https://github.com/shultz .. _@siauPatrick: https://github.com/siauPatrick +.. _@sladinji: https://github.com/sladinji .. _@slafs: https://github.com/slafs .. _@ssteinerX: https://github.com/ssteinerx .. _@stepmr: https://github.com/stepmr .. _@suledev: https://github.com/suledev .. _@takkaria: https://github.com/takkaria +.. _@tanoabeleyra: https://github.com/tanoabeleyra .. _@timclaessens: https://github.com/timclaessens .. _@timfreund: https://github.com/timfreund +.. _@townie: https://github.com/townie .. _@Travistock: https://github.com/Tavistock .. _@trungdong: https://github.com/trungdong .. _@Tubo: https://github.com/tubo +.. _@umrashrf: https://github.com/umrashrf .. _@viviangb: https://github.com/viviangb +.. _@vladdoster: https://github.com/vladdoster .. _@xpostudio4: https://github.com/xpostudio4 +.. _@yrchen: https://github.com/yrchen .. _@yunti: https://github.com/yunti .. _@zcho: https://github.com/zcho -.. _@phiberjenz: https://github.com/phiberjenz -.. _@sladinji: https://github.com/sladinji -.. _@andresgz: https://github.com/andresgz -.. _@jangeador: https://github.com/jangeador -.. _@townie: https://github.com/townie -.. _@MightySCollins: https://github.com/MightySCollins -.. _@dadokkio: https://github.com/dadokkio -.. _@bwarren2: https://github.com/bwarren2 -.. _@bertdemiranda: https://github.com/bertdemiranda -.. _@brentpayne: https://github.com/brentpayne -.. _@afrowave: https://github.com/afrowave -.. _@pchiquet: https://github.com/pchiquet -.. _@delneg: https://github.com/delneg -.. _@purplediane: https://github.com/purplediane -.. _@umrashrf: https://github.com/umrashrf -.. _@ahhda: https://github.com/ahhda -.. _@keithjeb: https://github.com/keithjeb -.. _@btknu: https://github.com/btknu -.. _@rolep: https://github.com/rolep -.. _@canonnervio: https://github.com/canonnervio -.. _@jcass77: https://github.com/jcass77 -.. _@Egregors: https://github.com/Egregors -.. _@saschalalala: https://github.com/saschalalala -.. _@mrcoles: https://github.com/mrcoles -.. _@ericgroom: https://github.com/ericgroom -.. _@hanaquadara: https://github.com/hanaquadara -.. _@vladdoster: https://github.com/vladdoster -.. _@cmargieson: https://github.com/cmargieson -.. _@tanoabeleyra: https://github.com/tanoabeleyra -.. _@keyvanm: https://github.com/keyvanm -.. _@yrchen: https://github.com/yrchen Special Thanks ~~~~~~~~~~~~~~ From fe49871dc83a72eab8454efbab926c2e9ff8fdbd Mon Sep 17 00:00:00 2001 From: Tim Claessens Date: Wed, 19 Jun 2019 14:24:46 +0200 Subject: [PATCH 220/507] Fix link --- CONTRIBUTORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index a580400c..bb519613 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -180,7 +180,7 @@ Listed in alphabetical order. Tano Abeleyra `@tanoabeleyra`_ Taylor Baldwin Théo Segonds `@show0k`_ - Tim Claessens `@timclaessens` + Tim Claessens `@timclaessens`_ Tim Freund `@timfreund`_ Tom Atkins `@knitatoms`_ Tom Offermann From b3e7e5045a0b938db89e7bf673a082f14dd51a8a Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 20 Jun 2019 12:00:29 +0100 Subject: [PATCH 221/507] Update sphinx from 2.1.1 to 2.1.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 46b602e6..1938e283 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.1 # https://github.com/sphinx-doc/sphinx +Sphinx==2.1.2 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From cba392bf9557d75759240c504f8de72beef73ffd Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 20 Jun 2019 12:00:34 +0100 Subject: [PATCH 222/507] Update mypy from 0.701 to 0.710 --- {{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 46b602e6..dc2c4376 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.701 # https://github.com/python/mypy +mypy==0.710 # https://github.com/python/mypy pytest==4.6.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From 81fd240b6c7df95012363b49985d47e7fc04dbb5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 20 Jun 2019 12:00:37 +0100 Subject: [PATCH 223/507] Update django-debug-toolbar from 1.11 to 2.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 46b602e6..6908eb25 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -29,7 +29,7 @@ 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-debug-toolbar==2.0 # https://github.com/jazzband/django-debug-toolbar 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 87a8acbae22b1e5fd4ad66b3ac637a4ac2077f2b Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Thu, 20 Jun 2019 23:35:46 +0800 Subject: [PATCH 224/507] Remove redundant template debug setting > 'debug': a boolean that turns on/off template debug mode. If it is > True, the fancy error page will display a detailed report for any > exception raised during template rendering. This report contains the > relevant snippet of the template with the appropriate line highlighted. > It defaults to the value of the DEBUG setting. https://docs.djangoproject.com/en/2.2/topics/templates/#module-django.template.backends.django I could be wrong about this, but it seems like setting the template DEBUG setting is redundant, since it should follow whatever the DEBUG variable is set to. --- CONTRIBUTORS.rst | 2 ++ {{cookiecutter.project_slug}}/config/settings/base.py | 2 -- {{cookiecutter.project_slug}}/config/settings/local.py | 5 ----- {{cookiecutter.project_slug}}/config/settings/test.py | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index bb519613..5a650b90 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -89,6 +89,7 @@ Listed in alphabetical order. Cullen Rhodes `@c-rhodes`_ Curtis St Pierre `@curtisstpierre`_ @cstpierre1388 Dan Shultz `@shultz`_ + Dani Hodovic `@danihodovic` Daniel Hepper `@dhepper`_ @danielhepper Daniele Tricoli `@eriol`_ David Díaz `@ddiazpinto`_ @DavidDiazPinto @@ -238,6 +239,7 @@ Listed in alphabetical order. .. _@Collederas: https://github.com/Collederas .. _@curtisstpierre: https://github.com/curtisstpierre .. _@dadokkio: https://github.com/dadokkio +.. _@danihodovic: https://github.com/danihodovic .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto .. _@delneg: https://github.com/delneg diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 2745058d..4ffa5021 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -171,8 +171,6 @@ TEMPLATES = [ # https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs "DIRS": [str(APPS_DIR.path("templates"))], "OPTIONS": { - # https://docs.djangoproject.com/en/dev/ref/settings/#template-debug - "debug": DEBUG, # https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders # https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types "loaders": [ diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 0c0588bd..bbc9ab35 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -23,11 +23,6 @@ CACHES = { } } -# TEMPLATES -# ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405 - # EMAIL # ------------------------------------------------------------------------------ {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' -%} diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 2ade134a..35e1a010 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -34,8 +34,6 @@ PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] # TEMPLATES # ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405 TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405 ( "django.template.loaders.cached.Loader", From 7b9ed36fac0fd3062545a33f8012d359e671daf3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 22 Jun 2019 12:00:28 +0100 Subject: [PATCH 225/507] Update sentry-sdk from 0.9.0 to 0.9.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 39998f7a..978a76ec 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --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.9.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.9.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 6b45fd08e6f497dfca675c2d7bde2ff36e85969b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 24 Jun 2019 12:00:28 +0100 Subject: [PATCH 226/507] Update sentry-sdk from 0.9.1 to 0.9.2 --- {{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 978a76ec..a36c0d22 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --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.9.1 # https://github.com/getsentry/sentry-python +sentry-sdk==0.9.2 # https://github.com/getsentry/sentry-python {%- endif %} # Django From e1c9f57624b17bf7717cb84e6633d08925a53daa Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 25 Jun 2019 12:00:31 +0100 Subject: [PATCH 227/507] Update django-model-utils from 3.1.2 to 3.2.0 --- {{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 f469aa92..d0ef213d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -21,7 +21,7 @@ flower==0.9.3 # https://github.com/mher/flower # ------------------------------------------------------------------------------ django==2.2.2 # 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-model-utils==3.2.0 # 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" %} From 2f95bedc139bc594ac0a5b30022fa27af0fdf1b0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 25 Jun 2019 12:00:34 +0100 Subject: [PATCH 228/507] Update mypy from 0.710 to 0.711 --- {{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 60a81363..16469b5a 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.710 # https://github.com/python/mypy +mypy==0.711 # https://github.com/python/mypy pytest==4.6.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From 784075e4d4c59adafcb1bd417360867063287bdc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 25 Jun 2019 04:28:27 -0700 Subject: [PATCH 229/507] Update pytest_cases from 1.9.0 to 1.9.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0db0861c..5e2e27f5 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.9.0 +pytest_cases==1.9.1 pytest-cookies==0.3.0 pytest-xdist==1.29.0 pyyaml==5.1.1 From 541b2f2fc0dd9c59f3b2d8ca3951efb22347f2d5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 26 Jun 2019 03:46:17 -0700 Subject: [PATCH 230/507] Update tox from 3.12.1 to 3.13.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5e2e27f5..c870c953 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ -tox==3.12.1 +tox==3.13.1 pytest==4.6.3 pytest_cases==1.9.1 pytest-cookies==0.3.0 From 64169d0a350e10ff9c0db7b6c127aadc5d0d0b16 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 26 Jun 2019 12:00:29 +0100 Subject: [PATCH 231/507] Update pytest_cases from 1.9.1 to 1.9.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5e2e27f5..4b12cf57 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.9.1 +pytest_cases==1.9.2 pytest-cookies==0.3.0 pytest-xdist==1.29.0 pyyaml==5.1.1 From 48cfa4e5ea6ccf73d938ab525bbcba79079763cd Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 28 Jun 2019 12:00:29 +0100 Subject: [PATCH 232/507] Update pytest_cases from 1.9.2 to 1.9.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2bead95c..d232c8b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.7 # ------------------------------------------------------------------------------ tox==3.13.1 pytest==4.6.3 -pytest_cases==1.9.2 +pytest_cases==1.9.3 pytest-cookies==0.3.0 pytest-xdist==1.29.0 pyyaml==5.1.1 From 46f4567b958832a0f74144b327fce24895443417 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 29 Jun 2019 12:00:32 +0100 Subject: [PATCH 233/507] Update sentry-sdk from 0.9.2 to 0.9.5 --- {{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 a36c0d22..f5a23f93 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --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.9.2 # https://github.com/getsentry/sentry-python +sentry-sdk==0.9.5 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 7be0c231b778827f5e0d14861dae626976544544 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 30 Jun 2019 13:00:29 +0200 Subject: [PATCH 234/507] Update pytest-django from 3.5.0 to 3.5.1 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 16469b5a..725c59ad 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==2.0 # https://github.com/jazzband/django-debug-toolbar 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 +pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django From dff4693869d225a58966dab35d5902269b66de0f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 30 Jun 2019 07:07:30 -0700 Subject: [PATCH 235/507] Update pytest from 4.6.3 to 5.0.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d232c8b7..5426efc4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ tox==3.13.1 -pytest==4.6.3 +pytest==5.0.0 pytest_cases==1.9.3 pytest-cookies==0.3.0 pytest-xdist==1.29.0 From cbd3a59d4b2ab13eaf5477112f8098066389cdc5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 1 Jul 2019 13:00:29 +0200 Subject: [PATCH 236/507] Update django from 2.2.2 to 2.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 d0ef213d..04ddb90d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.2 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.3 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth From 5c83f2416f06fefe21339e98e0b9ad6ab333e86c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 1 Jul 2019 13:00:32 +0200 Subject: [PATCH 237/507] Update pytest from 4.6.3 to 5.0.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 725c59ad..b379825e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.711 # https://github.com/python/mypy -pytest==4.6.3 # https://github.com/pytest-dev/pytest +pytest==5.0.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From ba83326a78da44034240748357547683091ea416 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 2 Jul 2019 12:00:28 +0100 Subject: [PATCH 238/507] Update tox from 3.13.1 to 3.13.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5426efc4..4b4df651 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ -tox==3.13.1 +tox==3.13.2 pytest==5.0.0 pytest_cases==1.9.3 pytest-cookies==0.3.0 From 93930913981631a9b731c1c08d9eadc419938959 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 3 Jul 2019 12:00:28 +0100 Subject: [PATCH 239/507] Update pillow from 6.0.0 to 6.1.0 --- {{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 04ddb90d..574a6df1 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2019.1 # https://github.com/stub42/pytz python-slugify==3.0.2 # https://github.com/un33k/python-slugify -Pillow==6.0.0 # https://github.com/python-pillow/Pillow +Pillow==6.1.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} From f557d26ee54560eccf3674762b571e912505bc16 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 4 Jul 2019 12:00:29 +0100 Subject: [PATCH 240/507] Update pytest_cases from 1.9.3 to 1.10.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4b4df651..49aab81d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.7 # ------------------------------------------------------------------------------ tox==3.13.2 pytest==5.0.0 -pytest_cases==1.9.3 +pytest_cases==1.10.1 pytest-cookies==0.3.0 pytest-xdist==1.29.0 pyyaml==5.1.1 From d3e50de3b7583b036a382464a65a58981521483d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 5 Jul 2019 12:00:28 +0100 Subject: [PATCH 241/507] Update pytest-cookies from 0.3.0 to 0.4.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 49aab81d..3ee71613 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,6 @@ flake8==3.7.7 tox==3.13.2 pytest==5.0.0 pytest_cases==1.10.1 -pytest-cookies==0.3.0 +pytest-cookies==0.4.0 pytest-xdist==1.29.0 pyyaml==5.1.1 From ed9fcb90924fa35526404797c613a96e5cc852eb Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 6 Jul 2019 12:00:29 +0100 Subject: [PATCH 242/507] Update pytest from 5.0.0 to 5.0.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3ee71613..501af714 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.7 # Testing # ------------------------------------------------------------------------------ tox==3.13.2 -pytest==5.0.0 +pytest==5.0.1 pytest_cases==1.10.1 pytest-cookies==0.4.0 pytest-xdist==1.29.0 From bd071be43ebf7d8b3a95cec01b39a156fa62d77d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 6 Jul 2019 12:00:30 +0100 Subject: [PATCH 243/507] Update pytest from 5.0.0 to 5.0.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 b379825e..02e9acb0 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.711 # https://github.com/python/mypy -pytest==5.0.0 # https://github.com/pytest-dev/pytest +pytest==5.0.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 8f31052d7e647bc4e5830087e534611f9b1d1e4c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 6 Jul 2019 12:00:33 +0100 Subject: [PATCH 244/507] Update sentry-sdk from 0.9.5 to 0.10.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 f5a23f93..2abdba84 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --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.9.5 # https://github.com/getsentry/sentry-python +sentry-sdk==0.10.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 0026e98c1457719293ddaf46a342806927331f72 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 8 Jul 2019 12:00:29 +0100 Subject: [PATCH 245/507] Update django-anymail from 6.0.1 to 6.1.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 2abdba84..7c217e74 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 == '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 +django-anymail[mailgun]==6.1.0 # https://github.com/anymail/django-anymail From f00c1f6f70d0af23085ab7d468f54dc8b71086dc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 8 Jul 2019 12:00:32 +0100 Subject: [PATCH 246/507] Update pylint-django from 2.0.9 to 2.0.10 --- {{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 02e9acb0..ec2cf2c4 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.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 +pylint-django==2.0.10 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From f02aa463a7eeb66fb8d22d744f40e962b51e7ef9 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Mon, 8 Jul 2019 14:14:59 +0800 Subject: [PATCH 247/507] Always use test settings in pytest You can alternatively use DJANGO_SETTINGS_MODULE, but this is overridden by the environment variable of the same name. In order to always run it with test settings, regardless of the environment variable use --ds. https://pytest-django.readthedocs.io/en/latest/configuring_django.html --- {{cookiecutter.project_slug}}/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pytest.ini b/{{cookiecutter.project_slug}}/pytest.ini index 690c78f1..9fb488cb 100644 --- a/{{cookiecutter.project_slug}}/pytest.ini +++ b/{{cookiecutter.project_slug}}/pytest.ini @@ -1,5 +1,5 @@ [pytest] -DJANGO_SETTINGS_MODULE=config.settings.test +addopts = --ds=config.settings.test {%- if cookiecutter.js_task_runner != 'None' %} norecursedirs = node_modules {%- endif %} From a25c406975ee2bcd35f2b70b3c9eacb8c69759e7 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Tue, 9 Jul 2019 09:00:31 +0800 Subject: [PATCH 248/507] Remove gunicorn from installed apps I can't find the requirement of adding it to INSTALLED_APPS on the Django or the Gunicorn docs. https://docs.gunicorn.org/en/latest/run.html?highlight=django#django https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/gunicorn/ --- {{cookiecutter.project_slug}}/config/settings/production.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index d838dc4f..214353de 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -179,10 +179,6 @@ ANYMAIL = { "MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"), } -# Gunicorn -# ------------------------------------------------------------------------------ -INSTALLED_APPS += ["gunicorn"] # noqa F405 - {% if cookiecutter.use_whitenoise == 'y' -%} # WhiteNoise # ------------------------------------------------------------------------------ From 14697391095ba211e53a22c648ad691c4eeebd67 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Tue, 9 Jul 2019 09:07:38 +0800 Subject: [PATCH 249/507] Remove EMAIL_HOST & EMAIL_PORT with locmem backend These settings should not be required since Django never connects to an external component when sending email. Instead it's stored in memory. https://docs.djangoproject.com/en/2.2/topics/email/#in-memory-backend --- {{cookiecutter.project_slug}}/config/settings/test.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 35e1a010..89660a3f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -48,10 +48,6 @@ TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405 # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" -# https://docs.djangoproject.com/en/dev/ref/settings/#email-host -EMAIL_HOST = "localhost" -# https://docs.djangoproject.com/en/dev/ref/settings/#email-port -EMAIL_PORT = 1025 # Your stuff... # ------------------------------------------------------------------------------ From 35b201a2b39402f479aa05c585334c2562afc581 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Tue, 9 Jul 2019 09:11:50 +0800 Subject: [PATCH 250/507] Add EMAIL_TIMEOUT Adds EMAIL_TIMEOUT to prevent a blocking send on the tcp socket from halting the thread handling the request. --- {{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 4ffa5021..7def8f48 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -216,6 +216,8 @@ X_FRAME_OPTIONS = "DENY" EMAIL_BACKEND = env( "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.smtp.EmailBackend" ) +# https://docs.djangoproject.com/en/2.2/ref/settings/#email-timeout +EMAIL_TIMEOUT = 5 # ADMIN # ------------------------------------------------------------------------------ From 6fa463d0a1e20fcd0df2fc287cbaf7bf0c9485c1 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 9 Jul 2019 12:00:28 +0100 Subject: [PATCH 251/507] Update flake8 from 3.7.7 to 3.7.8 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 501af714..e5d371ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ black==19.3b0 -flake8==3.7.7 +flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ From e0aacb328e105d519522c94aefc0c0c6c0e905c9 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 9 Jul 2019 12:00:29 +0100 Subject: [PATCH 252/507] Update flake8 from 3.7.7 to 3.7.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 ec2cf2c4..1a91d131 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.7 # https://github.com/PyCQA/flake8 +flake8==3.7.8 # 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.10 # https://github.com/PyCQA/pylint-django From c8b557753616f45887a5e811b0423e0b612c29e5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 10 Jul 2019 12:00:28 +0100 Subject: [PATCH 253/507] Update sentry-sdk from 0.10.0 to 0.10.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 7c217e74..bb95373b 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --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.10.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.10.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 2ab85f4303bc0ac70e2c5c232c4b283c889c60ae Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 11 Jul 2019 12:00:28 +0100 Subject: [PATCH 254/507] Update pylint-django from 2.0.10 to 2.0.11 --- {{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 1a91d131..0f8aaac1 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.8 # 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.10 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From 3abf0fec3aef6f455baf89d4b4d9b194ac429df5 Mon Sep 17 00:00:00 2001 From: 2O4 <> Date: Thu, 11 Jul 2019 13:44:38 +0200 Subject: [PATCH 255/507] fixed buttons --- .../templates/account/password_reset_from_key.html | 2 +- .../templates/account/password_set.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html index 2171144d..671eb12c 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html @@ -15,7 +15,7 @@
{% csrf_token %} {{ form|crispy }} - +
{% else %}

{% trans 'Your password is now changed.' %}

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html index c9827715..563a0b18 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html @@ -11,7 +11,7 @@
{% csrf_token %} {{ form|crispy }} - +
{% endblock %} {% endraw %} From 2c3ce19f4bc901a0ade4f48cc748e94c70fa2ad6 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 12 Jul 2019 11:52:32 +0100 Subject: [PATCH 256/507] Add 2O4 to list of contributors --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 5a650b90..725f49c9 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -42,6 +42,7 @@ Listed in alphabetical order. Name Github Twitter ========================== ============================ ============== 18 `@dezoito`_ + 2O4 `@2O4`_ a7p `@a7p`_ Aaron Eikenberry `@aeikenberry`_ Adam Bogdał `@bogdal`_ @@ -199,6 +200,7 @@ Listed in alphabetical order. ========================== ============================ ============== .. _@a7p: https://github.com/a7p +.. _@2O4: https://github.com/2O4 .. _@ad-m: https://github.com/ad-m .. _@adammsteele: https://github.com/adammsteele .. _@aeikenberry: https://github.com/aeikenberry From f2035ec617dd0a4da1c204b4b82545bd4c9172a4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 12 Jul 2019 12:05:48 +0100 Subject: [PATCH 257/507] Update Changelog --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f013aec9..5df2d3a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,39 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2019-07-09] +### Fixed +- Always use test settings in pytest (@danihodovic) +- Remove gunicorn from `INSTALLED_APPS` (@danihodovic) +- Remove `EMAIL_HOST` and `EMAIL_PORT` with locmem backend (@danihodovic) + +### Added +- Add `EMAIL_TIMEOUT` (@danihodovic) + +## [2019-06-22] +### Fixed +- Remove redundant template debug setting (@danihodovic) + +## [2019-06-19] +### Fixed +- Fix removal carriage returns in docker scripts (@timclaessens) + +## [2019-06-15] +### Fixed +- Issue with Pycharm setup for running things in Docker compose (@foarsitter) + +## [2019-06-06] +### Changed +- Update generated Travis config (@browniebroke) + +## [2019-06-03] +### Added +- Installed `django-celery-beat` to keep scheduled tasks in DB (@keyvanm) + +## [2019-05-28] +### Changed +- Use GCP acronym rather than inconsistent GCE/GCS (@tanoabeleyra) + ## [2019-05-27] ### Changed - Made cloud provider optional (@tanoabeleyra) From 28ddd76b25e7e9937b78b7338bf19ac4be7ae1b4 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 12 Jul 2019 12:06:19 +0100 Subject: [PATCH 258/507] Fix missing link in contributors list --- CONTRIBUTORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 725f49c9..0f9feea6 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -90,7 +90,7 @@ Listed in alphabetical order. Cullen Rhodes `@c-rhodes`_ Curtis St Pierre `@curtisstpierre`_ @cstpierre1388 Dan Shultz `@shultz`_ - Dani Hodovic `@danihodovic` + Dani Hodovic `@danihodovic`_ Daniel Hepper `@dhepper`_ @danielhepper Daniele Tricoli `@eriol`_ David Díaz `@ddiazpinto`_ @DavidDiazPinto From 80e7df010c27bef34d2e8482fd9cca000f5dc587 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 13 Jul 2019 12:00:29 +0100 Subject: [PATCH 259/507] Update mypy from 0.711 to 0.720 --- {{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 0f8aaac1..cfb2d28f 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.711 # https://github.com/python/mypy +mypy==0.720 # https://github.com/python/mypy pytest==5.0.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From e15965bd1955fc3ce2f18ef2899d5a5cb24e03bf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 14 Jul 2019 12:00:29 +0100 Subject: [PATCH 260/507] Update whitenoise from 4.1.2 to 4.1.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 574a6df1..19ab7e20 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == ' {%- endif %} argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} -whitenoise==4.1.2 # https://github.com/evansd/whitenoise +whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} redis==3.2.1 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} From c49acc64f91dd3a77c74fc33d9f394370071cbd7 Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Sun, 14 Jul 2019 15:22:36 +0200 Subject: [PATCH 261/507] Update views.py added message wich will be shown when a user update his infos --- .../{{cookiecutter.project_slug}}/users/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index a2442741..db2534f1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -2,6 +2,8 @@ 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, RedirectView, UpdateView +from django.contrib import messages +from django.utils.translation import ugettext_lazy as _ User = get_user_model() @@ -27,6 +29,11 @@ class UserUpdateView(LoginRequiredMixin, UpdateView): def get_object(self): return User.objects.get(username=self.request.user.username) + def form_valid(self, form): + form.save() + messages.add_message(self.request, messages.INFO, _("Infos succefully updated")) + return super(UserUpdateView, self).form_valid(form) + user_update_view = UserUpdateView.as_view() From 3aa7181a4606426ade2e6180ac421a10ba3a31ce Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Sun, 14 Jul 2019 15:55:50 +0200 Subject: [PATCH 262/507] Delete user_list.html Following on Remove user list view #2062 --- .../templates/users/user_list.html | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_list.html diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_list.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_list.html deleted file mode 100644 index c1d83251..00000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_list.html +++ /dev/null @@ -1,17 +0,0 @@ -{% raw %}{% extends "base.html" %} -{% load static i18n %} -{% block title %}Members{% endblock %} - -{% block content %} -
-

Users

- -
- {% for user in user_list %} - -

{{ user.username }}

-
- {% endfor %} -
-
-{% endblock content %}{% endraw %} From 5312d9b914b8049acab116f44a2f51d9e68d6a13 Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Sun, 14 Jul 2019 16:37:37 +0200 Subject: [PATCH 263/507] Added a button to close the message --- .../{{cookiecutter.project_slug}}/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 9caab43a..cba1b7cf 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -80,7 +80,7 @@ {% if messages %} {% for message in messages %} -
{{ message }}
+
{{ message }}
{% endfor %} {% endif %} From e99d27c1273ad14898a6d7f46b411b15eb60ace0 Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:10:27 +0200 Subject: [PATCH 264/507] Update {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py Co-Authored-By: Bruno Alla --- .../{{cookiecutter.project_slug}}/users/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index db2534f1..0a00f0c6 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -31,7 +31,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView): def form_valid(self, form): form.save() - messages.add_message(self.request, messages.INFO, _("Infos succefully updated")) + messages.add_message(self.request, messages.INFO, _("Infos successfully updated")) return super(UserUpdateView, self).form_valid(form) From 9da2a193673a064a93a57eca657ec48be9a9da13 Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:10:33 +0200 Subject: [PATCH 265/507] Update {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py Co-Authored-By: Bruno Alla --- .../{{cookiecutter.project_slug}}/users/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 0a00f0c6..b1c94a5e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -32,7 +32,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView): def form_valid(self, form): form.save() messages.add_message(self.request, messages.INFO, _("Infos successfully updated")) - return super(UserUpdateView, self).form_valid(form) + return super().form_valid(form) user_update_view = UserUpdateView.as_view() From a41c841613b4f0d2ec8405a774dc7057064bd55c Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:19:07 +0200 Subject: [PATCH 266/507] Update views.py --- .../{{cookiecutter.project_slug}}/users/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index b1c94a5e..1364568e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -30,7 +30,6 @@ class UserUpdateView(LoginRequiredMixin, UpdateView): return User.objects.get(username=self.request.user.username) def form_valid(self, form): - form.save() messages.add_message(self.request, messages.INFO, _("Infos successfully updated")) return super().form_valid(form) From f8b4f32c7a496e217bfc9cfe660213153a05146e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 16 Jul 2019 12:00:29 +0100 Subject: [PATCH 267/507] Update sentry-sdk from 0.10.1 to 0.10.2 --- {{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 bb95373b..f5e5ffea 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --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.10.1 # https://github.com/getsentry/sentry-python +sentry-sdk==0.10.2 # https://github.com/getsentry/sentry-python {%- endif %} # Django From b0cd6e40723e7870e643a00963f8b3b0b7b6daa0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 16 Jul 2019 12:00:32 +0100 Subject: [PATCH 268/507] Update djangorestframework from 3.9.4 to 3.10.0 --- {{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 19ab7e20..9513b223 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,5 +30,5 @@ django-compressor==2.3 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.9.4 # https://github.com/encode/django-rest-framework +djangorestframework==3.10.0 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From c0853452533aa178179c9fe622de782e9cd6a3b9 Mon Sep 17 00:00:00 2001 From: step21 Date: Wed, 17 Jul 2019 15:14:16 +0200 Subject: [PATCH 269/507] Rename 403_csrf.html to 403.html 403.html is the name that django expects, unless it is overriden. 403_csrf is a separate case, which according to django docs and mailing list should get a separate view/template. Fixes #2163 Docs: https://docs.djangoproject.com/en/2.1/ref/csrf/#rejected-requests Mailing list: https://groups.google.com/forum/#!msg/django-developers/O2raF0RVGA0/44-3Jz0jCwAJ Stackoverflow: https://stackoverflow.com/questions/31981239/django-custom-403-template --- .../templates/{403_csrf.html => 403.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{403_csrf.html => 403.html} (100%) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403_csrf.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html similarity index 100% rename from {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403_csrf.html rename to {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/403.html From 525739dcb5c89a1a29851f5ade0597b14f25c02d Mon Sep 17 00:00:00 2001 From: step21 Date: Wed, 17 Jul 2019 16:19:11 +0200 Subject: [PATCH 270/507] Update CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 0f9feea6..a36d59a7 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -108,6 +108,7 @@ Listed in alphabetical order. Eric Groom `@ericgroom`_ Eyad Al Sibai `@eyadsibai`_ Felipe Arruda `@arruda`_ + Florian Idelberger `@step21`_ @windrush Garry Cairns `@garry-cairns`_ Garry Polley `@garrypolley`_ Hamish Durkin `@durkode`_ From eac8ae626a632482fa901ca9c605267ae107823f Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 17 Jul 2019 15:52:46 +0100 Subject: [PATCH 271/507] Fix broken link --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index a36d59a7..4c3ad8a0 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -321,6 +321,7 @@ Listed in alphabetical order. .. _@sladinji: https://github.com/sladinji .. _@slafs: https://github.com/slafs .. _@ssteinerX: https://github.com/ssteinerx +.. _@step21: https://github.com/step21 .. _@stepmr: https://github.com/stepmr .. _@suledev: https://github.com/suledev .. _@takkaria: https://github.com/takkaria From 566cc3f3e4b3cc3d4d0ce86354e47657fbf880e0 Mon Sep 17 00:00:00 2001 From: 2O4 <35725720+2O4@users.noreply.github.com> Date: Wed, 17 Jul 2019 19:31:53 +0200 Subject: [PATCH 272/507] Update {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py Co-Authored-By: Bruno Alla --- .../{{cookiecutter.project_slug}}/users/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py index 1364568e..5c0d5b5c 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py @@ -30,7 +30,9 @@ class UserUpdateView(LoginRequiredMixin, UpdateView): return User.objects.get(username=self.request.user.username) def form_valid(self, form): - messages.add_message(self.request, messages.INFO, _("Infos successfully updated")) + messages.add_message( + self.request, messages.INFO, _("Infos successfully updated") + ) return super().form_valid(form) From fbacfa95e0eb7116f0e785207e8e704e994d535e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 18 Jul 2019 12:00:29 +0100 Subject: [PATCH 273/507] Update djangorestframework from 3.10.0 to 3.10.1 --- {{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 9513b223..74245c5c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,5 +30,5 @@ django-compressor==2.3 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.10.0 # https://github.com/encode/django-rest-framework +djangorestframework==3.10.1 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From cc47ee39e9b37d4eb642c0a7643d5011600f8f09 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 20 Jul 2019 12:00:29 +0100 Subject: [PATCH 274/507] Update django-extensions from 2.1.9 to 2.2.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 cfb2d28f..8ca3232f 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==2.0 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.1.9 # https://github.com/django-extensions/django-extensions +django-extensions==2.2.1 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django From f0546612a28275f888fa684e9148a03e48ac0079 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 27 Jul 2019 13:00:29 +0200 Subject: [PATCH 275/507] Update ipdb from 0.12 to 0.12.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 cfb2d28f..ef0d90af 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ -r ./base.txt Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug -ipdb==0.12 # https://github.com/gotcha/ipdb +ipdb==0.12.1 # https://github.com/gotcha/ipdb Sphinx==2.1.2 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 From 541374e27b16d8744a6b0a3d33cbc3b05e8e054f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 28 Jul 2019 13:00:29 +0200 Subject: [PATCH 276/507] Update python-slugify from 3.0.2 to 3.0.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 9513b223..20316865 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2019.1 # https://github.com/stub42/pytz -python-slugify==3.0.2 # https://github.com/un33k/python-slugify +python-slugify==3.0.3 # https://github.com/un33k/python-slugify Pillow==6.1.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From 3bf19e93f2067ae876f1f6f74a3cbe673e8b5dd0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 29 Jul 2019 13:00:28 +0200 Subject: [PATCH 277/507] Update redis from 3.2.1 to 3.3.0 --- {{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 9513b223..b3bc9c2e 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.2.1 # https://github.com/antirez/redis +redis==3.3.0 # 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 From ff182ce997de8a3174c9cb166e49bd93632872a3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 30 Jul 2019 12:00:29 +0100 Subject: [PATCH 278/507] Update redis from 3.3.0 to 3.3.2 --- {{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 bca54bc2..9c99245b 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.0 # https://github.com/antirez/redis +redis==3.3.2 # 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 From 57ba93c69c2cbed9777154a86a8161445be8e2bb Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 30 Jul 2019 12:00:32 +0100 Subject: [PATCH 279/507] Update djangorestframework from 3.10.1 to 3.10.2 --- {{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 bca54bc2..5ec1644f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,5 +30,5 @@ django-compressor==2.3 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.10.1 # https://github.com/encode/django-rest-framework +djangorestframework==3.10.2 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From f540784c35034306f01f1a9bb839fa5b49f3a956 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 30 Jul 2019 12:00:36 +0100 Subject: [PATCH 280/507] Update coverage from 4.5.3 to 4.5.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 5bfb1536..6d95b5b1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -18,7 +18,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ flake8==3.7.8 # https://github.com/PyCQA/flake8 -coverage==4.5.3 # https://github.com/nedbat/coveragepy +coverage==4.5.4 # https://github.com/nedbat/coveragepy black==19.3b0 # https://github.com/ambv/black pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From 2a373ebeff4e1b346d15deeb293f8ad8cda81c0f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 31 Jul 2019 12:00:29 +0100 Subject: [PATCH 281/507] Update redis from 3.3.0 to 3.3.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 bca54bc2..5c3199a0 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.0 # https://github.com/antirez/redis +redis==3.3.4 # 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 From ba05c40cfb6862c1801aa37c1916e86d869119a9 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 31 Jul 2019 12:00:32 +0100 Subject: [PATCH 282/507] Update ipdb from 0.12.1 to 0.12.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 5bfb1536..bb8ca83d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ -r ./base.txt Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug -ipdb==0.12.1 # https://github.com/gotcha/ipdb +ipdb==0.12.2 # https://github.com/gotcha/ipdb Sphinx==2.1.2 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 From 5e9f6f3aac856ddcaaa41964dada04235926b24a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 31 Jul 2019 17:45:48 -0700 Subject: [PATCH 283/507] Update pyyaml from 5.1.1 to 5.1.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e5d371ed..6f4445a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,4 @@ pytest==5.0.1 pytest_cases==1.10.1 pytest-cookies==0.4.0 pytest-xdist==1.29.0 -pyyaml==5.1.1 +pyyaml==5.1.2 From ffbc44a3302308a48cc1151d9429e2f1d1e4c34f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 1 Aug 2019 12:00:30 +0100 Subject: [PATCH 284/507] Update pytz from 2019.1 to 2019.2 --- {{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 bca54bc2..d2a8f7af 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -pytz==2019.1 # https://github.com/stub42/pytz +pytz==2019.2 # https://github.com/stub42/pytz python-slugify==3.0.3 # https://github.com/un33k/python-slugify Pillow==6.1.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} From b562008a6c7223b90f8454c7cc9b7d2e61d20175 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 1 Aug 2019 12:00:33 +0100 Subject: [PATCH 285/507] Update django from 2.2.3 to 2.2.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 bca54bc2..780bee5a 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.3 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.4 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth From b4349cafdc665364bd97459069930ab91c81389d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 2 Aug 2019 12:00:29 +0100 Subject: [PATCH 286/507] Update pytest_cases from 1.10.1 to 1.11.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6f4445a7..003b4a1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.13.2 pytest==5.0.1 -pytest_cases==1.10.1 +pytest_cases==1.11.1 pytest-cookies==0.4.0 pytest-xdist==1.29.0 pyyaml==5.1.2 From 0d3fb0509e0f2fb18c6b5d18a7cc7de871d088ec Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 3 Aug 2019 12:00:29 +0100 Subject: [PATCH 287/507] Update redis from 3.3.4 to 3.3.5 --- {{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 a7e03a36..20723671 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.4 # https://github.com/antirez/redis +redis==3.3.5 # 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 From 406f51ac172f5606b7f5a077b78084c0c0f9e9cc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 7 Aug 2019 12:00:29 +0100 Subject: [PATCH 288/507] Update redis from 3.3.5 to 3.3.6 --- {{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 20723671..0fb72f41 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.5 # https://github.com/antirez/redis +redis==3.3.6 # 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 From 5a8c6c28c69fb95cd2657f44c7c3854fcb16c7e5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 13 Aug 2019 12:00:28 +0100 Subject: [PATCH 289/507] Update collectfast from 0.6.2 to 1.0.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 f5e5ffea..b48de34a 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn 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 +Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.10.2 # https://github.com/getsentry/sentry-python From 081accfafbc985cb38a0ce4d9a5ecbeaa64b9853 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 14 Aug 2019 12:00:29 +0100 Subject: [PATCH 290/507] Update redis from 3.3.6 to 3.3.7 --- {{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 0fb72f41..631048f7 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.6 # https://github.com/antirez/redis +redis==3.3.7 # 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 From 7594b4f03025dae5954358fa47d1e897c0157793 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 16 Aug 2019 12:00:28 +0100 Subject: [PATCH 291/507] Update pytest from 5.0.1 to 5.1.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 003b4a1f..c3f21bd4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.13.2 -pytest==5.0.1 +pytest==5.1.0 pytest_cases==1.11.1 pytest-cookies==0.4.0 pytest-xdist==1.29.0 From cc0ff897b247461cd31952c181b211e2682da938 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 16 Aug 2019 12:00:29 +0100 Subject: [PATCH 292/507] Update pytest from 5.0.1 to 5.1.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 17c47bb2..85328c03 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.720 # https://github.com/python/mypy -pytest==5.0.1 # https://github.com/pytest-dev/pytest +pytest==5.1.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From c1fb6e078b969893f265f641264fc1e6e19227f6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 17 Aug 2019 13:00:31 +0200 Subject: [PATCH 293/507] Update sentry-sdk from 0.10.2 to 0.11.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 b48de34a..c21fb992 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.10.2 # https://github.com/getsentry/sentry-python +sentry-sdk==0.11.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From b42d000b56ce5a87092ba8c56d3b397ea693e0a2 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 19 Aug 2019 13:00:34 +0200 Subject: [PATCH 294/507] Update sphinx from 2.1.2 to 2.2.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 85328c03..03441394 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.2 # https://github.com/gotcha/ipdb -Sphinx==2.1.2 # https://github.com/sphinx-doc/sphinx +Sphinx==2.2.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From 5ddadc0afac5c25fe54132e1130d7c97b70da3b0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 20 Aug 2019 13:00:29 +0200 Subject: [PATCH 295/507] Update sentry-sdk from 0.11.0 to 0.11.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 c21fb992..eadd410d 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.11.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.11.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django From ac294b8515e17f1d07b15e5172318bf5411d0e51 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 20 Aug 2019 13:00:32 +0200 Subject: [PATCH 296/507] Update redis from 3.3.7 to 3.3.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 631048f7..f5c4f338 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.3 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.7 # https://github.com/antirez/redis +redis==3.3.8 # 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 From e82a7d0fb29044b93601d8357e95af3822987fd3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 21 Aug 2019 13:00:29 +0200 Subject: [PATCH 297/507] Update pytest from 5.1.0 to 5.1.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c3f21bd4..2f85a700 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.13.2 -pytest==5.1.0 +pytest==5.1.1 pytest_cases==1.11.1 pytest-cookies==0.4.0 pytest-xdist==1.29.0 From 72b222d52dd01bdd639467806a79f0fba8fc3020 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 21 Aug 2019 13:00:30 +0200 Subject: [PATCH 298/507] Update pytest from 5.1.0 to 5.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 03441394..0a417575 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.720 # https://github.com/python/mypy -pytest==5.1.0 # https://github.com/pytest-dev/pytest +pytest==5.1.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 7ad879193782c2933722dfbcb3ea273a88aa62f1 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Wed, 21 Aug 2019 17:28:55 +0200 Subject: [PATCH 299/507] Remove EMAIL_HOST, EMAIL_PORT for console backend django.core.mail.backends.console.EmailBackend is an in memory backend so EMAIL_HOST and EMAIL_PORT does not need to be specified in this case. --- {{cookiecutter.project_slug}}/config/settings/local.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index bbc9ab35..2ab0a7cb 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -28,19 +28,19 @@ CACHES = { {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-host EMAIL_HOST = env("EMAIL_HOST", default="mailhog") +# https://docs.djangoproject.com/en/dev/ref/settings/#email-port +EMAIL_PORT = 1025 {%- elif cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'n' -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-host EMAIL_HOST = "localhost" +# https://docs.djangoproject.com/en/dev/ref/settings/#email-port +EMAIL_PORT = 1025 {%- else -%} # https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = env( "DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.console.EmailBackend" ) -# https://docs.djangoproject.com/en/dev/ref/settings/#email-host -EMAIL_HOST = "localhost" {%- endif %} -# https://docs.djangoproject.com/en/dev/ref/settings/#email-port -EMAIL_PORT = 1025 # django-debug-toolbar # ------------------------------------------------------------------------------ From d4d8f1b5be114ce840ac863c4fdd725ebd436261 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Sun, 25 Aug 2019 14:08:28 +0200 Subject: [PATCH 300/507] Remove AWS_PRELOAD_METADATA https://github.com/antonagestam/collectfast/pull/140 --- {{cookiecutter.project_slug}}/config/settings/production.py | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 214353de..e3741165 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -201,7 +201,6 @@ COMPRESS_URL = STATIC_URL{% if cookiecutter.use_whitenoise == 'y' or cookiecutte # ------------------------------------------------------------------------------ # https://github.com/antonagestam/collectfast#installation INSTALLED_APPS = ["collectfast"] + INSTALLED_APPS # noqa F405 -AWS_PRELOAD_METADATA = True {% endif %} # LOGGING # ------------------------------------------------------------------------------ From 180ab9bbb192fc0e648c67e52f3d7701792b552f Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Mon, 26 Aug 2019 16:25:36 +0200 Subject: [PATCH 301/507] Remove redundant DEBUG = False in test.py This is already set to False by default in base.py --- {{cookiecutter.project_slug}}/config/settings/test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index 89660a3f..fad41afd 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -7,8 +7,6 @@ from .base import env # GENERAL # ------------------------------------------------------------------------------ -# https://docs.djangoproject.com/en/dev/ref/settings/#debug -DEBUG = False # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = env( "DJANGO_SECRET_KEY", From 58a2262190a2025065ddedd09141a54883ac52b9 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 30 Aug 2019 13:00:28 +0200 Subject: [PATCH 302/507] Update django-allauth from 0.39.1 to 0.40.0 --- {{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 f5c4f338..be85fb2e 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -22,7 +22,7 @@ flower==0.9.3 # https://github.com/mher/flower django==2.2.4 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils -django-allauth==0.39.1 # https://github.com/pennersr/django-allauth +django-allauth==0.40.0 # 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.3 # https://github.com/django-compressor/django-compressor From c0554db343ed79197422a27e3d7da82fe20966c9 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 31 Aug 2019 13:00:33 +0200 Subject: [PATCH 303/507] Update sentry-sdk from 0.11.1 to 0.11.2 --- {{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 eadd410d..1714398f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.11.1 # https://github.com/getsentry/sentry-python +sentry-sdk==0.11.2 # https://github.com/getsentry/sentry-python {%- endif %} # Django From df36bf1f550a95103def6b667f5de893867fc0db Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 2 Sep 2019 12:00:29 +0100 Subject: [PATCH 304/507] Update django from 2.2.4 to 2.2.5 --- {{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 f5c4f338..170a888f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.4 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.5 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth From 7fd095a926f9768ecdd11732ff17156e55345248 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 3 Sep 2019 21:17:42 -0700 Subject: [PATCH 305/507] Update tox from 3.13.2 to 3.14.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2f85a700..b9cff303 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ -tox==3.13.2 +tox==3.14.0 pytest==5.1.1 pytest_cases==1.11.1 pytest-cookies==0.4.0 From c6bd37adcc51f2c22cb06bf8d504163da01fc803 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Wed, 4 Sep 2019 15:58:20 +0200 Subject: [PATCH 306/507] Add default tests.py file pattern to pytest `./manage.py startapp` generates a tests.py file by default. This is ignored by pytest unless specified. --- {{cookiecutter.project_slug}}/pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_slug}}/pytest.ini b/{{cookiecutter.project_slug}}/pytest.ini index 9fb488cb..52b48ab0 100644 --- a/{{cookiecutter.project_slug}}/pytest.ini +++ b/{{cookiecutter.project_slug}}/pytest.ini @@ -1,5 +1,6 @@ [pytest] addopts = --ds=config.settings.test +python_files = tests.py test_*.py {%- if cookiecutter.js_task_runner != 'None' %} norecursedirs = node_modules {%- endif %} From 1c98ff011b212ad385699fe5d437bac41f130a0b Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 4 Sep 2019 11:05:03 -0700 Subject: [PATCH 307/507] Update pytest from 5.1.1 to 5.1.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b9cff303..4e265809 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.0 -pytest==5.1.1 +pytest==5.1.2 pytest_cases==1.11.1 pytest-cookies==0.4.0 pytest-xdist==1.29.0 From f1a04205e70bf7a4bbe14968839207ad05a7edcf Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 4 Sep 2019 19:08:56 +0100 Subject: [PATCH 308/507] Update pytest from 5.1.1 to 5.1.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 0a417575..c1df0b84 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.720 # https://github.com/python/mypy -pytest==5.1.1 # https://github.com/pytest-dev/pytest +pytest==5.1.2 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From c29795b1dc7e2d125bf07b027b88a2d853fb9966 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 5 Sep 2019 13:00:31 +0200 Subject: [PATCH 309/507] Update djangorestframework from 3.10.2 to 3.10.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 3fe638e6..24198e55 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,5 +30,5 @@ django-compressor==2.3 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.10.2 # https://github.com/encode/django-rest-framework +djangorestframework==3.10.3 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From 69566f54561cd5f7d0f7954a0423d4ad759337d6 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Thu, 22 Aug 2019 14:57:00 +0200 Subject: [PATCH 310/507] Add context processor for settings variables This allows for usage of settings variables in templates, e.g ``` {% if settings.USE_ANALYTICS %} {% endif %} ``` --- {{cookiecutter.project_slug}}/config/settings/base.py | 1 + .../{{cookiecutter.project_slug}}/utils/__init__.py | 0 .../utils/context_processors.py | 5 +++++ 3 files changed, 6 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/__init__.py create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/context_processors.py diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 7def8f48..41f0f46c 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -187,6 +187,7 @@ TEMPLATES = [ "django.template.context_processors.static", "django.template.context_processors.tz", "django.contrib.messages.context_processors.messages", + "{{ cookiecutter.project_slug }}.utils.context_processors.settings_context", ], }, } diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/context_processors.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/context_processors.py new file mode 100644 index 00000000..de405076 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/utils/context_processors.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def settings_context(_request): + return {"settings": settings} From fb3d4ff25ceb4bb01f0fdb4f40d739435962097d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 5 Sep 2019 08:35:31 -0700 Subject: [PATCH 311/507] Update pytest_cases from 1.11.1 to 1.11.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b9cff303..c7652899 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.0 pytest==5.1.1 -pytest_cases==1.11.1 +pytest_cases==1.11.2 pytest-cookies==0.4.0 pytest-xdist==1.29.0 pyyaml==5.1.2 From e5f9dd2c783a6ec63d7b606e8b5cb6b9d3c0eb3c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 8 Sep 2019 13:00:29 +0200 Subject: [PATCH 312/507] Update django-anymail from 6.1.0 to 7.0.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 1714398f..1863a493 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 == 'GCP' %} django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages {%- endif %} -django-anymail[mailgun]==6.1.0 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==7.0.0 # https://github.com/anymail/django-anymail From db777571c457a92d85cbe08d2de12b06f3fede30 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 10 Sep 2019 13:00:29 +0200 Subject: [PATCH 313/507] Update django-storages from 1.7.1 to 1.7.2 --- {{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 1714398f..379281ab 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -14,7 +14,7 @@ sentry-sdk==0.11.2 # https://github.com/getsentry/sentry-python # Django # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} -django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages +django-storages[boto3]==1.7.2 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCP' %} django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages {%- endif %} From fab5bf8a040b9d3467581bfadbb1eee4f97bcf56 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 10 Sep 2019 13:00:30 +0200 Subject: [PATCH 314/507] Update django-storages from 1.7.1 to 1.7.2 --- {{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 379281ab..5b1387e2 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,6 +16,6 @@ sentry-sdk==0.11.2 # https://github.com/getsentry/sentry-python {%- if cookiecutter.cloud_provider == 'AWS' %} django-storages[boto3]==1.7.2 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCP' %} -django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages +django-storages[google]==1.7.2 # https://github.com/jschneier/django-storages {%- endif %} django-anymail[mailgun]==6.1.0 # https://github.com/anymail/django-anymail From 548417612fb98ed8d23253ac7dd29ce96f47a64a Mon Sep 17 00:00:00 2001 From: Jerome Caisip Date: Fri, 13 Sep 2019 14:43:12 +0800 Subject: [PATCH 315/507] Additonal option to setup DRF. --- CONTRIBUTORS.rst | 2 ++ cookiecutter.json | 1 + hooks/post_gen_project.py | 8 +++++++ .../config/api_router.py | 14 +++++++++++ .../config/settings/base.py | 16 +++++++++++-- {{cookiecutter.project_slug}}/config/urls.py | 11 +++++++++ .../users/api/serializers.py | 12 ++++++++++ .../users/api/views.py | 24 +++++++++++++++++++ 8 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/config/api_router.py create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 4c3ad8a0..f1981cbd 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -120,6 +120,7 @@ Listed in alphabetical order. Irfan Ahmad `@erfaan`_ @erfaan Jan Van Bruggen `@jvanbrug`_ Jelmer Draaijer `@foarsitter`_ + Jerome Caisip `@jeromecaisip`_ Jens Nilsson `@phiberjenz`_ Jerome Leclanche `@jleclanche`_ @Adys Jimmy Gitonga `@afrowave`_ @afrowave @@ -276,6 +277,7 @@ Listed in alphabetical order. .. _@jangeador: https://github.com/jangeador .. _@jazztpt: https://github.com/jazztpt .. _@jcass77: https://github.com/jcass77 +.. _@jeromecaisip: https://github.com/jeromecaisip .. _@jleclanche: https://github.com/jleclanche .. _@juliocc: https://github.com/juliocc .. _@jvanbrug: https://github.com/jvanbrug diff --git a/cookiecutter.json b/cookiecutter.json index d6d217ca..5e70bedb 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -33,6 +33,7 @@ "GCP", "None" ], + "use_drf": "n", "custom_bootstrap_compilation": "n", "use_compressor": "n", "use_celery": "n", diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ff84f180..42d5dcee 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -279,6 +279,11 @@ def remove_node_dockerfile(): shutil.rmtree(os.path.join("compose", "local", "node")) +def remove_drf_starter_files(): + os.remove(os.path.join("config", "api_router.py")) + shutil.rmtree(os.path.join("{{cookiecutter.project_slug}}", "users", "api")) + + def main(): debug = "{{ cookiecutter.debug }}".lower() == "y" @@ -342,6 +347,9 @@ def main(): if "{{ cookiecutter.use_travisci }}".lower() == "n": remove_dottravisyml_file() + if "{{ cookiecutter.use_drf }}".lower() == "n": + remove_drf_starter_files() + print(SUCCESS + "Project initialized, keep up the good work!" + TERMINATOR) diff --git a/{{cookiecutter.project_slug}}/config/api_router.py b/{{cookiecutter.project_slug}}/config/api_router.py new file mode 100644 index 00000000..fc8107b4 --- /dev/null +++ b/{{cookiecutter.project_slug}}/config/api_router.py @@ -0,0 +1,14 @@ +from rest_framework.routers import DefaultRouter, SimpleRouter +from django.conf import settings +from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet + +if settings.DEBUG: + router = DefaultRouter() +else: + router = SimpleRouter() + +router.register('users', UserViewSet) + + +app_name = 'api' +urlpatterns = router.urls diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 41f0f46c..a6081950 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -292,14 +292,26 @@ ACCOUNT_EMAIL_VERIFICATION = "mandatory" ACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.AccountAdapter" # https://django-allauth.readthedocs.io/en/latest/configuration.html SOCIALACCOUNT_ADAPTER = "{{cookiecutter.project_slug}}.users.adapters.SocialAccountAdapter" - {% if cookiecutter.use_compressor == 'y' -%} # django-compressor # ------------------------------------------------------------------------------ # https://django-compressor.readthedocs.io/en/latest/quickstart/#installation INSTALLED_APPS += ["compressor"] STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"] - +{%- endif %} +{% if cookiecutter.use_drf == "y" -%} +# django-reset-framework +# ------------------------------------------------------------------------------- +# django-rest-framework - https://www.django-rest-framework.org/api-guide/settings/ +REST_FRAMEWORK = { + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework.authentication.SessionAuthentication', + 'rest_framework.authentication.TokenAuthentication', + ), + 'DEFAULT_PERMISSION_CLASSES': ( + 'rest_framework.permissions.IsAuthenticated', + ) +} {%- endif %} # Your stuff... # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/config/urls.py b/{{cookiecutter.project_slug}}/config/urls.py index 909d5e86..5382bdb7 100644 --- a/{{cookiecutter.project_slug}}/config/urls.py +++ b/{{cookiecutter.project_slug}}/config/urls.py @@ -4,6 +4,9 @@ from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views +{% if cookiecutter.use_drf == 'y' -%} +from rest_framework.authtoken.views import obtain_auth_token +{%- endif %} urlpatterns = [ path("", TemplateView.as_view(template_name="pages/home.html"), name="home"), @@ -17,6 +20,14 @@ urlpatterns = [ path("accounts/", include("allauth.urls")), # Your stuff: custom urls includes go here ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +{% if cookiecutter.use_drf == 'y' -%} +# API URLS +urlpatterns += [ + # API base url + path("api/", include('config.api_router')), + # DRF auth token + path("auth-token/", obtain_auth_token)] +{%- endif %} if settings.DEBUG: # This allows the error pages to be debugged during development, just visit diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py new file mode 100644 index 00000000..8fc2262e --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py @@ -0,0 +1,12 @@ +from rest_framework import serializers +from {{ cookiecutter.project_slug }}.users.models import User + +class UserSerializer(serializers.ModelSerializer): + class Meta: + model = User + fields = ['username', 'email', 'name', 'url'] + + extra_kwargs = { + 'url': {'view_name': 'api:user-detail', 'lookup_field': 'username'} + } + diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py new file mode 100644 index 00000000..440cc9b2 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py @@ -0,0 +1,24 @@ +from django.contrib.auth import get_user_model +from rest_framework import status +from rest_framework.decorators import action +from rest_framework.mixins import RetrieveModelMixin, ListModelMixin, UpdateModelMixin +from rest_framework.response import Response +from rest_framework.viewsets import GenericViewSet + + +from .serializers import UserSerializer +User = get_user_model() + + +class UserViewSet(RetrieveModelMixin, ListModelMixin, UpdateModelMixin, GenericViewSet): + serializer_class = UserSerializer + queryset = User.objects.all() + lookup_field = 'username' + + def get_queryset(self, *args, **kwargs): + return self.queryset.filter(id=self.request.user.id) + + @action(detail=False, methods=['GET']) + def me(self, request): + serializer = UserSerializer(request.user, context={'request': request}) + return Response(status=status.HTTP_200_OK, data=serializer.data) From f8963e0dd3935ebaff8614c4bde2af04f8e208c0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 19 Sep 2019 12:00:30 +0100 Subject: [PATCH 316/507] Update sentry-sdk from 0.11.2 to 0.12.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 5b1387e2..a602a700 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.11.2 # https://github.com/getsentry/sentry-python +sentry-sdk==0.12.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From ce3547e890459323d9fbfd3c7c9a4b5e3331b1e2 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 21 Sep 2019 12:00:30 +0100 Subject: [PATCH 317/507] Update sentry-sdk from 0.12.0 to 0.12.2 --- {{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 a602a700..6dd36371 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.12.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.12.2 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 02689f67e74c5117933174b374b4f6b02f91c80d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 21 Sep 2019 12:00:33 +0100 Subject: [PATCH 318/507] Update python-slugify from 3.0.3 to 3.0.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 24198e55..ae16b0e8 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2019.2 # https://github.com/stub42/pytz -python-slugify==3.0.3 # https://github.com/un33k/python-slugify +python-slugify==3.0.4 # https://github.com/un33k/python-slugify Pillow==6.1.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From 26ecff778e5bb61e52fb58bff6a745e381e8dae9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 22 Sep 2019 00:50:31 -0700 Subject: [PATCH 319/507] Update pytest from 5.1.2 to 5.1.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f4d12375..a4eb4a53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.0 -pytest==5.1.2 +pytest==5.1.3 pytest_cases==1.11.2 pytest-cookies==0.4.0 pytest-xdist==1.29.0 From aa573427948b4cd25c9db74174953fc48b88f732 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 23 Sep 2019 12:00:28 +0100 Subject: [PATCH 320/507] Update pytest from 5.1.2 to 5.1.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 c1df0b84..2b221294 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.720 # https://github.com/python/mypy -pytest==5.1.2 # https://github.com/pytest-dev/pytest +pytest==5.1.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From e924a55d7875ea992104b0440f2eda6c725bcb37 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 25 Sep 2019 12:00:29 +0100 Subject: [PATCH 321/507] Update whitenoise from 4.1.3 to 4.1.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 ae16b0e8..e2871f71 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == ' {%- endif %} argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} -whitenoise==4.1.3 # https://github.com/evansd/whitenoise +whitenoise==4.1.4 # https://github.com/evansd/whitenoise {%- endif %} redis==3.3.8 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} From 9e5343dd31d64e3eea45e1d19dc944fe7f29cb8c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 27 Sep 2019 12:00:30 +0100 Subject: [PATCH 322/507] Update mypy from 0.720 to 0.730 --- {{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 2b221294..a96d64b4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.720 # https://github.com/python/mypy +mypy==0.730 # https://github.com/python/mypy pytest==5.1.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From 7d0f8606edadc082b5f49e5c50af823a80e8b246 Mon Sep 17 00:00:00 2001 From: Nicolas Stefani Date: Sun, 29 Sep 2019 09:41:13 -0300 Subject: [PATCH 323/507] Update python image to 3.7 --- {{cookiecutter.project_slug}}/compose/local/django/Dockerfile | 2 +- .../compose/production/django/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 67937822..a98547bd 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6-alpine +FROM python:3.7-alpine ENV PYTHONUNBUFFERED 1 diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 37f66ec7..b0861d60 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -9,7 +9,7 @@ RUN npm run build # Python build stage {%- endif %} -FROM python:3.6-alpine +FROM python:3.7-alpine ENV PYTHONUNBUFFERED 1 From 1f68e370eef449e0419a425fa4adbd5869a17513 Mon Sep 17 00:00:00 2001 From: Nicolas Stefani Date: Sun, 29 Sep 2019 21:04:21 -0300 Subject: [PATCH 324/507] Updated python version to 3.7 --- .travis.yml | 4 ++-- tox.ini | 2 +- {{cookiecutter.project_slug}}/.travis.yml | 2 +- {{cookiecutter.project_slug}}/runtime.txt | 2 +- {{cookiecutter.project_slug}}/setup.cfg | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c2bcdf42..925d82e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ services: language: python -python: 3.6 +python: 3.7 before_install: - docker-compose -v @@ -14,7 +14,7 @@ before_install: matrix: include: - name: Test results - script: tox -e py36 + script: tox -e py37 - name: Run flake8 on result script: tox -e flake8 - name: Run black on result diff --git a/tox.ini b/tox.ini index 7ee93915..1c83465c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = true -envlist = py36,flake8,black,black-template +envlist = py37,flake8,black,black-template [testenv] deps = -rrequirements.txt diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index 2d86ac31..31695e41 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -10,7 +10,7 @@ before_install: - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm language: python python: - - "3.6" + - "3.7" install: - pip install -r requirements/local.txt script: diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 9fbd3bf0..6f651a3b 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.6.8 +python-3.7.3 diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index c2139f1d..42b63861 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -7,7 +7,7 @@ max-line-length = 120 exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules [mypy] -python_version = 3.6 +python_version = 3.7 check_untyped_defs = True ignore_errors = False ignore_missing_imports = True From ea52a0be251e17b838f0b1f686ae8f578a70b6f6 Mon Sep 17 00:00:00 2001 From: Nicolas Stefani Date: Sun, 29 Sep 2019 21:46:34 -0300 Subject: [PATCH 325/507] Updated python version in warning message --- hooks/pre_gen_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 91332f14..5cda07b6 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -35,7 +35,7 @@ if "{{ cookiecutter.use_docker }}".lower() == "n": if python_major_version == 2: print( WARNING + "You're running cookiecutter under Python 2, but the generated " - "project requires Python 3.6+. Do you want to proceed (y/n)? " + TERMINATOR + "project requires Python 3.7+. Do you want to proceed (y/n)? " + TERMINATOR ) yes_options, no_options = frozenset(["y"]), frozenset(["n"]) while True: From 02a092876f0b6e83ddeec43b3987afc1b16da549 Mon Sep 17 00:00:00 2001 From: Nicolas Stefani Date: Sun, 29 Sep 2019 21:47:33 -0300 Subject: [PATCH 326/507] Updated python version in classifiers --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 46c84b71..33032009 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ setup( "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development", ], From acb72cb84cbc4f208ae39882dcb329d3b88fc8ec Mon Sep 17 00:00:00 2001 From: Nicolas Stefani Date: Sun, 29 Sep 2019 21:48:04 -0300 Subject: [PATCH 327/507] Updated docs --- CONTRIBUTING.rst | 4 ++-- README.rst | 2 +- docs/deployment-on-pythonanywhere.rst | 2 +- docs/developing-locally.rst | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cfe16740..cb59ae5f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -39,9 +39,9 @@ To run all tests using various versions of python in virtualenvs defined in tox. It is possible to test with a specific version of python. To do this, the command is:: - $ tox -e py36 + $ tox -e py37 -This will run py.test with the python3.6 interpreter, for example. +This will run py.test with the python3.7 interpreter, for example. To run a particular test with tox for against your current Python version:: diff --git a/README.rst b/README.rst index 30a3a2db..e4f47351 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ Features --------- * For Django 2.2 -* Works with Python 3.6 +* Works with Python 3.7 * Renders Django projects with 100% starting test coverage * Twitter Bootstrap_ v4 (`maintained Foundation fork`_ also available) * 12-Factor_ based settings via django-environ_ diff --git a/docs/deployment-on-pythonanywhere.rst b/docs/deployment-on-pythonanywhere.rst index 83b23b27..4738d5a5 100644 --- a/docs/deployment-on-pythonanywhere.rst +++ b/docs/deployment-on-pythonanywhere.rst @@ -35,7 +35,7 @@ Make sure your project is fully committed and pushed up to Bitbucket or Github o git clone # you can also use hg cd my-project-name - mkvirtualenv --python=/usr/bin/python3.6 my-project-name + mkvirtualenv --python=/usr/bin/python3.7 my-project-name pip install -r requirements/production.txt # may take a few minutes diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index 8694dde7..fdab5a90 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -9,7 +9,7 @@ Setting Up Development Environment Make sure to have the following on your host: -* Python 3.6 +* Python 3.7 * PostgreSQL_. * Redis_, if using Celery @@ -17,7 +17,7 @@ First things first. #. Create a virtualenv: :: - $ python3.6 -m venv + $ python3.7 -m venv #. Activate the virtualenv you have just created: :: From 51bf90cdcaf64d1e981b721e8338434f6cec990f Mon Sep 17 00:00:00 2001 From: Nicolas Stefani Date: Sun, 29 Sep 2019 22:17:06 -0300 Subject: [PATCH 328/507] add name to contributors --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 4c3ad8a0..67372491 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -158,6 +158,7 @@ Listed in alphabetical order. Michael Gecht `@mimischi`_ @_mischi Min ho Kim `@minho42`_ mozillazg `@mozillazg`_ + Nico Stefani `@nicolas471`_ @moby_dick91 Oleg Russkin `@rolep`_ Pablo `@oubiga`_ Parbhat Puri `@parbhat`_ From d6b0bf8bb08769fb9cdf2e1d0a4b2a4a9a76de5c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 30 Sep 2019 00:04:00 -0700 Subject: [PATCH 329/507] Update pytest from 5.1.3 to 5.2.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a4eb4a53..27787f52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.0 -pytest==5.1.3 +pytest==5.2.0 pytest_cases==1.11.2 pytest-cookies==0.4.0 pytest-xdist==1.29.0 From 4aed40d74d7a003037c55a255cede4d0a901716f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 1 Oct 2019 12:00:29 +0100 Subject: [PATCH 330/507] Update django from 2.2.5 to 2.2.6 --- {{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 e2871f71..a7620e3c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.5 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.6 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth From 7b73c2eb920b4979f42c284072e9de543889bd05 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 1 Oct 2019 12:00:33 +0100 Subject: [PATCH 331/507] Update pytest from 5.1.3 to 5.2.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 a96d64b4..fd2f4eb3 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.730 # https://github.com/python/mypy -pytest==5.1.3 # https://github.com/pytest-dev/pytest +pytest==5.2.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From da15657224b08e5cb026863b7dc35b596e62db4c Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 1 Oct 2019 08:29:41 -0700 Subject: [PATCH 332/507] Update pytest_cases from 1.11.2 to 1.11.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 27787f52..a93b75a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.0 pytest==5.2.0 -pytest_cases==1.11.2 +pytest_cases==1.11.3 pytest-cookies==0.4.0 pytest-xdist==1.29.0 pyyaml==5.1.2 From 0e5902027e86eef7886ffcf31ae0c98ba3007506 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 1 Oct 2019 15:06:58 -0700 Subject: [PATCH 333/507] Update pytest-xdist from 1.29.0 to 1.30.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a93b75a3..e9d2afb2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,5 @@ tox==3.14.0 pytest==5.2.0 pytest_cases==1.11.3 pytest-cookies==0.4.0 -pytest-xdist==1.29.0 +pytest-xdist==1.30.0 pyyaml==5.1.2 From daa0265a39ab9b6e5a52a82c3d02dd7831713c89 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 2 Oct 2019 12:00:29 +0100 Subject: [PATCH 334/507] Update pillow from 6.1.0 to 6.2.0 --- {{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 a7620e3c..d0bce155 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2019.2 # https://github.com/stub42/pytz python-slugify==3.0.4 # https://github.com/un33k/python-slugify -Pillow==6.1.0 # https://github.com/python-pillow/Pillow +Pillow==6.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} From 8a471c97e8df910f6762b7dc257cf6ec1e867833 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 2 Oct 2019 12:00:33 +0100 Subject: [PATCH 335/507] Update django-extensions from 2.2.1 to 2.2.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 fd2f4eb3..1f5d7a54 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==2.0 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.2.1 # https://github.com/django-extensions/django-extensions +django-extensions==2.2.2 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django From 8e1211580f0fbc77dd3394c4c6b91913a45d8c44 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 2 Oct 2019 13:39:16 +0100 Subject: [PATCH 336/507] Create FUNDING.yml --- .github/FUNDING.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..9f4c97f3 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: danielroygreenfeld +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: ['https://www.patreon.com/browniebroke'] From 39e745dddf090aa1f06da1e5f6e12c669c3351a7 Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Wed, 2 Oct 2019 10:10:32 -0300 Subject: [PATCH 337/507] Fix #2250 -- No staticfile storage with GCP without Whitenoise --- {{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 e3741165..122871b1 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -107,6 +107,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 == 'GCP' -%} +STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% endif -%} From f3b46ec4251358b7dd5ae24236b7cd9cc0a0b441 Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Wed, 2 Oct 2019 10:12:31 -0300 Subject: [PATCH 338/507] Add to CONTRIBUTORS --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 4c3ad8a0..4bf682ff 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -74,6 +74,7 @@ Listed in alphabetical order. Bouke Haarsma Brent Payne `@brentpayne`_ @brentpayne Burhan Khalid            `@burhan`_                   @burhan + Caio Ariede `@caioariede`_ @caioariede Carl Johnson `@carlmjohnson`_ @carlmjohnson Catherine Devlin `@catherinedevlin`_ Cédric Gaspoz `@cgaspoz`_ From d0c208d10fcd335b7b37a6a05d4d8ee72b995793 Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Wed, 2 Oct 2019 12:03:33 -0300 Subject: [PATCH 339/507] Fix #2249 -- Broken static files with whitenoise=n & cloud_provider=none --- hooks/pre_gen_project.py | 9 +++++++++ tests/test_cookiecutter_generation.py | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 91332f14..7f9bd3ea 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -59,3 +59,12 @@ if "{{ cookiecutter.use_docker }}".lower() == "n": ) + TERMINATOR ) + +if ( + "{{ cookiecutter.use_whitenoise }}".lower() == "n" + and "{{ cookiecutter.cloud_provider }}" == "None" +): + print( + "You should either use Whitenoise or select a Cloud Provider to serve static files" + ) + sys.exit(1) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 77f71df5..dc729513 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -49,6 +49,11 @@ def context_combination( cloud_provider, ): """Fixture that parametrize the function where it's used.""" + if cloud_provider == "None": + # Either of the two should be set for serving static files, so if cloud provider + # is not set, we force Whitenoise to be set + use_whitenoise = "y" + return { "windows": windows, "use_docker": use_docker, @@ -157,3 +162,10 @@ def test_invalid_slug(cookies, context, slug): assert result.exit_code != 0 assert isinstance(result.exception, FailedHookException) + + +def test_no_whitenoise_and_no_cloud_provider(cookies, context): + context.update({"use_whitenoise": "n", "cloud_provider": "None"}) + result = cookies.bake(extra_context=context) + + assert result.exit_code == 1 From 9fffafc0950e214db263be797249005c35ef7db7 Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Wed, 2 Oct 2019 12:06:53 -0300 Subject: [PATCH 340/507] Add docstring --- tests/test_cookiecutter_generation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index dc729513..b02bba36 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -165,6 +165,7 @@ def test_invalid_slug(cookies, context, slug): def test_no_whitenoise_and_no_cloud_provider(cookies, context): + """It should not generate project if neither whitenoise or cloud provider are set""" context.update({"use_whitenoise": "n", "cloud_provider": "None"}) result = cookies.bake(extra_context=context) From 6e27a8beac7fcf02221041d5dec88ca314dc5452 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 3 Oct 2019 12:00:31 +0100 Subject: [PATCH 341/507] Update sentry-sdk from 0.12.2 to 0.12.3 --- {{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 0d74f6d1..46c1a89e 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.0.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.12.2 # https://github.com/getsentry/sentry-python +sentry-sdk==0.12.3 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 9f1821cadfae6a9782fb92e7d044f197413e0833 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 3 Oct 2019 12:00:34 +0100 Subject: [PATCH 342/507] Update django-extensions from 2.2.2 to 2.2.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 1f5d7a54..41813c47 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==2.0 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.2.2 # https://github.com/django-extensions/django-extensions +django-extensions==2.2.3 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django From 4f8834c0ebcf67d55fa8ed74b753ab665440d7b4 Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Thu, 3 Oct 2019 11:54:15 -0300 Subject: [PATCH 343/507] Update tests/test_cookiecutter_generation.py Co-Authored-By: Bruno Alla --- tests/test_cookiecutter_generation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index b02bba36..20e4f9ed 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -169,4 +169,5 @@ def test_no_whitenoise_and_no_cloud_provider(cookies, context): context.update({"use_whitenoise": "n", "cloud_provider": "None"}) result = cookies.bake(extra_context=context) - assert result.exit_code == 1 + assert result.exit_code != 0 + assert isinstance(result.exception, FailedHookException) From b8248f4758436d6ebb6ba79b7ad5c118de4d56de Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 4 Oct 2019 12:00:29 +0100 Subject: [PATCH 344/507] Update collectfast from 1.0.0 to 1.1.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 46c1a89e..fae99a3f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} -Collectfast==1.0.0 # https://github.com/antonagestam/collectfast +Collectfast==1.1.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.12.3 # https://github.com/getsentry/sentry-python From ff8a9de24eb73e70dda87190d6e649ee39ecc180 Mon Sep 17 00:00:00 2001 From: Caio Ariede Date: Fri, 4 Oct 2019 09:32:25 -0300 Subject: [PATCH 345/507] Updates --- .../config/settings/production.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 122871b1..7a5d5454 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -92,7 +92,6 @@ 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 == 'GCP' %} -DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" GS_BUCKET_NAME = env("DJANGO_GCP_STORAGE_BUCKET_NAME") GS_DEFAULT_ACL = "publicRead" {% endif -%} @@ -107,7 +106,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 == 'GCP' -%} -STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" +STATICFILES_STORAGE = "config.settings.production.StaticRootGoogleCloudStorage" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% endif -%} @@ -133,8 +132,21 @@ 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 == 'GCP' %} +from storages.backends.gcloud import GoogleCloudStorage # noqa E402 + + +class StaticRootGoogleCloudStorage(GoogleCloudStorage): + location = "static" + default_acl = "publicRead" + + +class MediaRootGoogleCloudStorage(GoogleCloudStorage): + location = "media" + file_overwrite = False + + +DEFAULT_FILE_STORAGE = "config.settings.production.MediaRootGoogleCloudStorage" 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 99ccd314d0b4f67f0847fe847838c4afacd7c2e9 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 4 Oct 2019 14:48:02 +0100 Subject: [PATCH 346/507] Add missing link --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 4bf682ff..3a6c7bd0 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -230,6 +230,7 @@ Listed in alphabetical order. .. _@c-rhodes: https://github.com/c-rhodes .. _@caffodian: https://github.com/caffodian .. _@canonnervio: https://github.com/canonnervio +.. _@caioariede: https://github.com/caioariede .. _@carlmjohnson: https://github.com/carlmjohnson .. _@catherinedevlin: https://github.com/catherinedevlin .. _@ccurvey: https://github.com/ccurvey From 5750330ac2674fe6e9ad361b28cb46e1dc5b8772 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 6 Oct 2019 10:28:15 +0100 Subject: [PATCH 347/507] Merge whitenoise & cloud provider parametrize in tests --- tests/test_cookiecutter_generation.py | 34 ++++++++++++++------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 20e4f9ed..f931bce0 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -11,9 +11,6 @@ from binaryornot.check import is_binary PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}" RE_OBJ = re.compile(PATTERN) -YN_CHOICES = ["y", "n"] -CLOUD_CHOICES = ["AWS", "GCE", "None"] - @pytest.fixture def context(): @@ -30,14 +27,24 @@ def context(): @pytest_fixture_plus -@pytest.mark.parametrize("windows", YN_CHOICES, ids=lambda yn: f"win:{yn}") -@pytest.mark.parametrize("use_docker", YN_CHOICES, ids=lambda yn: f"docker:{yn}") -@pytest.mark.parametrize("use_celery", YN_CHOICES, ids=lambda yn: f"celery:{yn}") -@pytest.mark.parametrize("use_mailhog", YN_CHOICES, ids=lambda yn: f"mailhog:{yn}") -@pytest.mark.parametrize("use_sentry", YN_CHOICES, ids=lambda yn: f"sentry:{yn}") -@pytest.mark.parametrize("use_compressor", YN_CHOICES, ids=lambda yn: f"cmpr:{yn}") -@pytest.mark.parametrize("use_whitenoise", YN_CHOICES, ids=lambda yn: f"wnoise:{yn}") -@pytest.mark.parametrize("cloud_provider", CLOUD_CHOICES, ids=lambda yn: f"cloud:{yn}") +@pytest.mark.parametrize("windows", ["y", "n"], ids=lambda yn: f"win:{yn}") +@pytest.mark.parametrize("use_docker", ["y", "n"], ids=lambda yn: f"docker:{yn}") +@pytest.mark.parametrize("use_celery", ["y", "n"], ids=lambda yn: f"celery:{yn}") +@pytest.mark.parametrize("use_mailhog", ["y", "n"], ids=lambda yn: f"mailhog:{yn}") +@pytest.mark.parametrize("use_sentry", ["y", "n"], ids=lambda yn: f"sentry:{yn}") +@pytest.mark.parametrize("use_compressor", ["y", "n"], ids=lambda yn: f"cmpr:{yn}") +@pytest.mark.parametrize( + "use_whitenoise,cloud_provider", + [ + ("y", "AWS"), + ("y", "GCP"), + ("y", "None"), + ("n", "AWS"), + ("n", "GCP"), + # no whitenoise + co cloud provider is not supported + ], + ids=lambda id: f"wnoise:{id[0]}-cloud:{id[1]}", +) def context_combination( windows, use_docker, @@ -49,11 +56,6 @@ def context_combination( cloud_provider, ): """Fixture that parametrize the function where it's used.""" - if cloud_provider == "None": - # Either of the two should be set for serving static files, so if cloud provider - # is not set, we force Whitenoise to be set - use_whitenoise = "y" - return { "windows": windows, "use_docker": use_docker, From 703e8509aa863478e6ba1ee6f20e29aada693d15 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 6 Oct 2019 11:09:13 +0100 Subject: [PATCH 348/507] Fix broken link in list of contributors --- CONTRIBUTORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index d14afcc9..3a3930b2 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -304,6 +304,7 @@ Listed in alphabetical order. .. _@mrcoles: https://github.com/mrcoles .. _@msaizar: https://github.com/msaizar .. _@myilmaz: https://github.com/myilmaz +.. _@nicolas471: https://github.com/nicolas471 .. _@noisy: https://github.com/noisy .. _@originell: https://github.com/originell .. _@oubiga: https://github.com/oubiga From 058d3a2add08cb337042b3a403251622e4e9baff Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 6 Oct 2019 11:15:28 +0100 Subject: [PATCH 349/507] Update changelog with recent changes --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df2d3a3..2e7d9220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2019-10-06] +### Changed +- Default Python version is now 3.7 (@nicolas471) + +## [2019-10-04] +### Fixed +- Fix static files handling on GCP (@caioariede) + +## [2019-10-03] +### Fixed +- Fix incompatible combination between Whitenoise and no cloud provider (@caioariede) + ## [2019-07-09] ### Fixed - Always use test settings in pytest (@danihodovic) From 98a443626b7b359b629e5e51502d0bb7ed8519d8 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sun, 6 Oct 2019 13:07:20 +0100 Subject: [PATCH 350/507] Update to latest Python 3.7 runtime on Heroku --- {{cookiecutter.project_slug}}/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 6f651a3b..42731f2f 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.7.3 +python-3.7.4 From 973fbfe7a463acf14fb16c39ff5037240a20903d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 7 Oct 2019 12:00:30 +0100 Subject: [PATCH 351/507] Update pytest from 5.2.0 to 5.2.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e9d2afb2..efc3d117 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.0 -pytest==5.2.0 +pytest==5.2.1 pytest_cases==1.11.3 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From 86fd35bba6d8b04679f6dba01cae5e32771ea28c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 7 Oct 2019 12:00:31 +0100 Subject: [PATCH 352/507] Update pytest from 5.2.0 to 5.2.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 41813c47..daa4870c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.730 # https://github.com/python/mypy -pytest==5.2.0 # https://github.com/pytest-dev/pytest +pytest==5.2.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From b338a7490a042ca36d07612a3b1dfdd7eedf1910 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 7 Oct 2019 12:00:34 +0100 Subject: [PATCH 353/507] Update collectfast from 1.1.0 to 1.2.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 fae99a3f..e59644ff 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} -Collectfast==1.1.0 # https://github.com/antonagestam/collectfast +Collectfast==1.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.12.3 # https://github.com/getsentry/sentry-python From ca9addbbefa91654077acfd332150a503bd8e175 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 7 Oct 2019 12:00:36 +0100 Subject: [PATCH 354/507] Update pytz from 2019.2 to 2019.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 d0bce155..01791e8c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -pytz==2019.2 # https://github.com/stub42/pytz +pytz==2019.3 # https://github.com/stub42/pytz python-slugify==3.0.4 # https://github.com/un33k/python-slugify Pillow==6.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} From 5e196b45e9f6c1b45b30e942df38526b53587f36 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 10 Oct 2019 11:36:48 +0100 Subject: [PATCH 355/507] Pin Traefik Docker image to v1 Until we do the required changes to update to v2. Fixes #2258 --- .../compose/production/traefik/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index 7088e6fe..d7363a1a 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,4 +1,4 @@ -FROM traefik:alpine +FROM traefik:1.7-alpine RUN mkdir -p /etc/traefik/acme RUN touch /etc/traefik/acme/acme.json RUN chmod 600 /etc/traefik/acme/acme.json From 93473cb39adff9c6317ee93b5d7d6becb9a553ce Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 11 Oct 2019 12:00:29 +0100 Subject: [PATCH 356/507] Update python-slugify from 3.0.4 to 3.0.6 --- {{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 01791e8c..f7b0b4d3 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2019.3 # https://github.com/stub42/pytz -python-slugify==3.0.4 # https://github.com/un33k/python-slugify +python-slugify==3.0.6 # https://github.com/un33k/python-slugify Pillow==6.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From f26cad1faa9761aded5b214b1688297208b764dc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 11 Oct 2019 12:00:32 +0100 Subject: [PATCH 357/507] Update redis from 3.3.8 to 3.3.10 --- {{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 01791e8c..3f96a898 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.4 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.8 # https://github.com/antirez/redis +redis==3.3.10 # 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 From be8afa27b3a7f02e6ddadaa676915572a5a20b63 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 14 Oct 2019 12:00:29 +0100 Subject: [PATCH 358/507] Update redis from 3.3.10 to 3.3.11 --- {{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 1270a25e..049d75f1 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.4 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.10 # https://github.com/antirez/redis +redis==3.3.11 # 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 From f8cbea93aa070195bd1beb674755e1f999d1c3e6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 17 Oct 2019 12:00:29 +0100 Subject: [PATCH 359/507] Update mypy from 0.730 to 0.740 --- {{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 daa4870c..6f4289c3 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.730 # https://github.com/python/mypy +mypy==0.740 # https://github.com/python/mypy pytest==5.2.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From f87757f4abec4dd0e427df72ee3c47bf33a08154 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 17 Oct 2019 12:00:31 +0100 Subject: [PATCH 360/507] Update pytest-django from 3.5.1 to 3.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 daa4870c..a0c7b525 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==2.0 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.3 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin -pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django +pytest-django==3.6.0 # https://github.com/pytest-dev/pytest-django From c8ebb633cfc2c4b1b8e08aedcf0b7e7fe5876e8d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 18 Oct 2019 12:00:29 +0100 Subject: [PATCH 361/507] Update sentry-sdk from 0.12.3 to 0.13.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 e59644ff..10d1ea5b 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.12.3 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 42e5581198dd3f40448d89d486bcf6c6372ae955 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 18 Oct 2019 12:00:32 +0100 Subject: [PATCH 362/507] Update django-crispy-forms from 1.7.2 to 1.8.0 --- {{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 049d75f1..9bf87407 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ django==2.2.6 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth -django-crispy-forms==1.7.2 # https://github.com/django-crispy-forms/django-crispy-forms +django-crispy-forms==1.8.0 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.3 # https://github.com/django-compressor/django-compressor {%- endif %} From 96ade99c66c396ec2cac70f93cb173ef8ec2208c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 20 Oct 2019 12:00:29 +0100 Subject: [PATCH 363/507] Update psycopg2-binary from 2.8.3 to 2.8.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 dd795609..c7e9aa92 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -6,7 +6,7 @@ Sphinx==2.2.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} -psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2 +psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 {%- endif %} # Testing From 58f41fc97f9fc1ebf6853c7855a9450d9c92e8f1 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Mon, 21 Oct 2019 09:59:37 +0200 Subject: [PATCH 364/507] fix: remove the aws Dockerfile and remove the awscli definition from production.yml when not selected --- hooks/post_gen_project.py | 7 +++++++ {{cookiecutter.project_slug}}/production.yml | 3 +++ 2 files changed, 10 insertions(+) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ff84f180..95815564 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -279,6 +279,10 @@ def remove_node_dockerfile(): shutil.rmtree(os.path.join("compose", "local", "node")) +def remove_aws_dockerfile(): + shutil.rmtree(os.path.join("compose", "production", "aws")) + + def main(): debug = "{{ cookiecutter.debug }}".lower() == "y" @@ -302,6 +306,9 @@ def main(): else: remove_docker_files() + if "{{ cookiecutter.use_docker }}".lower() == "y" and "{{ cookiecutter.cloud_provider}}".lower() != 'aws': + remove_aws_dockerfile() + if "{{ cookiecutter.use_heroku }}".lower() == "n": remove_heroku_files() diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 331cbba6..62ec9d82 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -65,6 +65,8 @@ services: command: /start-flower {%- endif %} + + {% if cookiecutter.cloud_provider == 'AWS' %} awscli: build: context: . @@ -73,3 +75,4 @@ services: - ./.envs/.production/.django volumes: - production_postgres_data_backups:/backups + {%- endif %} From eb8ea447e488df634373e44de36e4aad7fd2dfb3 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Mon, 21 Oct 2019 11:12:53 +0200 Subject: [PATCH 365/507] fix: black --- hooks/post_gen_project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 95815564..0544f14b 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -306,7 +306,10 @@ def main(): else: remove_docker_files() - if "{{ cookiecutter.use_docker }}".lower() == "y" and "{{ cookiecutter.cloud_provider}}".lower() != 'aws': + if ( + "{{ cookiecutter.use_docker }}".lower() == "y" + and "{{ cookiecutter.cloud_provider}}".lower() != "aws" + ): remove_aws_dockerfile() if "{{ cookiecutter.use_heroku }}".lower() == "n": From 39c33c550c5e26e2edece8b759ba4fc77cba5b7d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 21 Oct 2019 12:00:29 +0100 Subject: [PATCH 366/507] Update python-slugify from 3.0.6 to 4.0.0 --- {{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 9bf87407..91b1e79c 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,5 +1,5 @@ pytz==2019.3 # https://github.com/stub42/pytz -python-slugify==3.0.6 # https://github.com/un33k/python-slugify +python-slugify==4.0.0 # https://github.com/un33k/python-slugify Pillow==6.2.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin From 8cce6df70aae9ce59ca746dd2419a9d284e254cf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 21 Oct 2019 12:00:32 +0100 Subject: [PATCH 367/507] Update django-extensions from 2.2.3 to 2.2.5 --- {{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 dd795609..1068b194 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==2.0 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.2.3 # https://github.com/django-extensions/django-extensions +django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.6.0 # https://github.com/pytest-dev/pytest-django From 400fcc4030fec8cff85cca30082a70977fb14716 Mon Sep 17 00:00:00 2001 From: Yuchen Xie Date: Tue, 22 Oct 2019 10:20:00 +0800 Subject: [PATCH 368/507] Prevent collectfast from guessing a wrong strategy If `COLLECTFAST_STRATEGY` is not provided in `settings`, `collectfast` has to guess a "strategy". For the case with AWS, it guesses `BotoStrategy` in stead of `S3Boto3Storage`, which is a wrong decision as we `pip install django-storages[boto3]` (`boto3` in favor of `boto`). Setting `COLLECTFAST_STRATEGY` is also encouraged as `collectfast` is not going to guess the strategy in the future. Ref: * https://github.com/antonagestam/collectfast/blob/f37dd1faa2046a2ebb88c098eb03e56a95534ec6/collectfast/management/commands/collectstatic.py#L33 * https://github.com/antonagestam/collectfast/blob/f37dd1faa2046a2ebb88c098eb03e56a95534ec6/collectfast/strategies/base.py#L170 --- CONTRIBUTORS.rst | 2 ++ {{cookiecutter.project_slug}}/config/settings/production.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 3a3930b2..90bb6395 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -200,6 +200,7 @@ Listed in alphabetical order. William Archinal `@archinal`_ Xaver Y.R. Chen `@yrchen`_ @yrchen Yaroslav Halchenko + Yuchen Xie `@mapx`_ ========================== ============================ ============== .. _@a7p: https://github.com/a7p @@ -291,6 +292,7 @@ Listed in alphabetical order. .. _@knitatoms: https://github.com/knitatoms .. _@krzysztofzuraw: https://github.com/krzysztofzuraw .. _@MathijsHoogland: https://github.com/MathijsHoogland +.. _@mapx: https://github.com/mapx .. _@mattayes: https://github.com/mattayes .. _@menzenski: https://github.com/menzenski .. _@mfwarren: https://github.com/mfwarren diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 7a5d5454..712f2bf4 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -104,9 +104,11 @@ GS_DEFAULT_ACL = "publicRead" STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" {% elif cookiecutter.cloud_provider == 'AWS' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootS3Boto3Storage" +COLLECTFAST_STRATEGY = "collectfast.strategies.boto3.Boto3Strategy" STATIC_URL = f"https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/static/" {% elif cookiecutter.cloud_provider == 'GCP' -%} STATICFILES_STORAGE = "config.settings.production.StaticRootGoogleCloudStorage" +COLLECTFAST_STRATEGY = "collectfast.strategies.gcloud.GoogleCloudStrategy" STATIC_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/static/" {% endif -%} From 998733411c7340a451c4099bd93f4d23c24b8eaf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 22 Oct 2019 12:00:35 +0100 Subject: [PATCH 369/507] Update pillow from 6.2.0 to 6.2.1 --- {{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 9bf87407..efff1c48 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2019.3 # https://github.com/stub42/pytz python-slugify==3.0.6 # https://github.com/un33k/python-slugify -Pillow==6.2.0 # https://github.com/python-pillow/Pillow +Pillow==6.2.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} From 3f0134a64b2dd148af1e59de4ce75780096f5d2b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 23 Oct 2019 12:00:31 +0100 Subject: [PATCH 370/507] Update collectfast from 1.2.0 to 1.3.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 10d1ea5b..a036e77e 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} -Collectfast==1.2.0 # https://github.com/antonagestam/collectfast +Collectfast==1.3.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.13.0 # https://github.com/getsentry/sentry-python From 662ca222054e0acbbfac6aae1fae1dc7e6f5a264 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 24 Oct 2019 12:00:29 +0100 Subject: [PATCH 371/507] Update pytest_cases from 1.11.3 to 1.11.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index efc3d117..c90fb4cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.0 pytest==5.2.1 -pytest_cases==1.11.3 +pytest_cases==1.11.4 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.1.2 From bd61b797325d3545801940ca5a3013d05ede52d4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 25 Oct 2019 12:00:36 +0100 Subject: [PATCH 372/507] Update pytest from 5.2.1 to 5.2.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index efc3d117..0614fa8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.0 -pytest==5.2.1 +pytest==5.2.2 pytest_cases==1.11.3 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From c2aa615fdc1c94d8d1a1ef8f33b5859ef7c6d6e4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 25 Oct 2019 12:00:37 +0100 Subject: [PATCH 373/507] Update pytest from 5.2.1 to 5.2.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 1d08dcb7..5dfff7ea 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.740 # https://github.com/python/mypy -pytest==5.2.1 # https://github.com/pytest-dev/pytest +pytest==5.2.2 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From b7976b9c3623adbac35904928522174035daaf12 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 25 Oct 2019 12:00:40 +0100 Subject: [PATCH 374/507] Update sentry-sdk from 0.13.0 to 0.13.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 a036e77e..00c1a16c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django From caa8b5a303a20065741193710455b5568f543029 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 26 Oct 2019 12:00:30 +0100 Subject: [PATCH 375/507] Update sphinx from 2.2.0 to 2.2.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 5dfff7ea..bb60bed0 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.2 # https://github.com/gotcha/ipdb -Sphinx==2.2.0 # https://github.com/sphinx-doc/sphinx +Sphinx==2.2.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From d006bc610c3d431d9544c4d5b27aa812cc2b93c5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 28 Oct 2019 11:00:30 +0000 Subject: [PATCH 376/507] Update collectfast from 1.3.0 to 1.3.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 00c1a16c..d65a0cbc 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,7 +5,7 @@ gunicorn==19.9.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} -Collectfast==1.3.0 # https://github.com/antonagestam/collectfast +Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} sentry-sdk==0.13.1 # https://github.com/getsentry/sentry-python From 9b61317682d402c1c232b3f9c486ffebd5a99339 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 28 Oct 2019 11:00:33 +0000 Subject: [PATCH 377/507] Update argon2-cffi from 19.1.0 to 19.2.0 --- {{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 efff1c48..33ac3f7b 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -4,7 +4,7 @@ Pillow==6.2.1 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} -argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi +argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==4.1.4 # https://github.com/evansd/whitenoise {%- endif %} From bb6188d43111536cbd6767a54c4f12d5a9647be8 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 28 Oct 2019 21:10:07 -0500 Subject: [PATCH 378/507] Update black from 19.3b0 to 19.10b0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 39080994..13398eb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -black==19.3b0 +black==19.10b0 flake8==3.7.8 # Testing From 10e395f65c1bc8133e99720afe3b1bcfe01edbd5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 29 Oct 2019 11:00:32 +0000 Subject: [PATCH 379/507] Update black from 19.3b0 to 19.10b0 --- {{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 bb60bed0..5756ebe4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -19,7 +19,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # ------------------------------------------------------------------------------ flake8==3.7.8 # https://github.com/PyCQA/flake8 coverage==4.5.4 # https://github.com/nedbat/coveragepy -black==19.3b0 # https://github.com/ambv/black +black==19.10b0 # https://github.com/ambv/black pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery From 4a194c6966dcc5157610a175b2fe30646121491b Mon Sep 17 00:00:00 2001 From: leollon Date: Tue, 29 Oct 2019 22:47:27 +0800 Subject: [PATCH 380/507] Add pre-commit for the generated project. (#2171) --- CONTRIBUTORS.rst | 2 ++ README.rst | 2 ++ docs/developing-locally.rst | 6 ++++++ .../.pre-commit-config.yaml | 19 +++++++++++++++++++ .../requirements/local.txt | 1 + 5 files changed, 30 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/.pre-commit-config.yaml diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 90bb6395..5224de1f 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -137,6 +137,7 @@ Listed in alphabetical order. Keyvan Mosharraf `@keyvanm`_ Krzysztof Szumny `@noisy`_ Krzysztof Żuraw `@krzysztofzuraw`_ + Leo won `@leollon`_ Leo Zhou `@glasslion`_ Leonardo Jimenez `@xpostudio4`_ Lin Xianyi `@iynaix`_ @@ -291,6 +292,7 @@ Listed in alphabetical order. .. _@keyvanm: https://github.com/keyvanm .. _@knitatoms: https://github.com/knitatoms .. _@krzysztofzuraw: https://github.com/krzysztofzuraw +.. _@leollon: https://github.com/leollon .. _@MathijsHoogland: https://github.com/MathijsHoogland .. _@mapx: https://github.com/mapx .. _@mattayes: https://github.com/mattayes diff --git a/README.rst b/README.rst index e4f47351..4be3c4bc 100644 --- a/README.rst +++ b/README.rst @@ -53,6 +53,7 @@ Features * Instructions for deploying to PythonAnywhere_ * Run tests with unittest or pytest * Customizable PostgreSQL version +* Default integration with pre-commit_ for identifying simple issues before submission to code review .. _`maintained Foundation fork`: https://github.com/Parbhat/cookiecutter-django-foundation @@ -84,6 +85,7 @@ Optional Integrations .. _PythonAnywhere: https://www.pythonanywhere.com/ .. _Traefik: https://traefik.io/ .. _LetsEncrypt: https://letsencrypt.org/ +.. _pre-commit: https://github.com/pre-commit/pre-commit Constraints ----------- diff --git a/docs/developing-locally.rst b/docs/developing-locally.rst index fdab5a90..7a58d099 100644 --- a/docs/developing-locally.rst +++ b/docs/developing-locally.rst @@ -26,6 +26,12 @@ First things first. #. Install development requirements: :: $ pip install -r requirements/local.txt + $ pre-commit install + + .. note:: + + the `pre-commit` exists in the generated project as default. + for the details of `pre-commit`, follow the [site of pre-commit](https://pre-commit.com/). #. Create a new PostgreSQL database using createdb_: :: diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml new file mode 100644 index 00000000..b9d69a9a --- /dev/null +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +exclude: 'docs|node_modules|migrations|.git|.tox' +default_stages: [commit] +fail_fast: true + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: master + hooks: + - id: trailing-whitespace + files: (^|/)a/.+\.(py|html|sh|css|js)$ + +- repo: local + hooks: + - id: flake8 + name: flake8 + entry: flake8 + language: python + types: [python] + diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index bb60bed0..73104eda 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -24,6 +24,7 @@ pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} +pre-commit==1.20.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From 04f3ae75dc731d72336e648bb4a653f62d7d5757 Mon Sep 17 00:00:00 2001 From: Bruce Olivier Date: Sat, 2 Nov 2019 15:57:05 -0500 Subject: [PATCH 381/507] Added more settings to .editorconfig to run isort and have black compatibility. --- CONTRIBUTORS.rst | 2 ++ {{cookiecutter.project_slug}}/.editorconfig | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 90bb6395..8a1d9c45 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -73,6 +73,7 @@ Listed in alphabetical order. Bo Lopker `@blopker`_ Bouke Haarsma Brent Payne `@brentpayne`_ @brentpayne + Bruce Olivier `@bolivierjr`_ Burhan Khalid            `@burhan`_                   @burhan Caio Ariede `@caioariede`_ @caioariede Carl Johnson `@carlmjohnson`_ @carlmjohnson @@ -225,6 +226,7 @@ Listed in alphabetical order. .. _@bloodpet: https://github.com/bloodpet .. _@blopker: https://github.com/blopker .. _@bogdal: https://github.com/bogdal +.. _@bolivierjr: https://github.com/bolivierjr .. _@brentpayne: https://github.com/brentpayne .. _@btknu: https://github.com/btknu .. _@burhan: https://github.com/burhan diff --git a/{{cookiecutter.project_slug}}/.editorconfig b/{{cookiecutter.project_slug}}/.editorconfig index b19266bf..792dd3b0 100644 --- a/{{cookiecutter.project_slug}}/.editorconfig +++ b/{{cookiecutter.project_slug}}/.editorconfig @@ -13,10 +13,16 @@ indent_style = space indent_size = 4 [*.py] -line_length=120 -known_first_party={{ cookiecutter.project_slug }} -multi_line_output=3 -default_section=THIRDPARTY +line_length = 120 +known_first_party = {{ cookiecutter.project_slug }} +multi_line_output = 3 +default_section = THIRDPARTY +recursive = true +skip = venv/ +skip_glob = **/migrations/*.py +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true [*.{html,css,scss,json,yml}] indent_style = space From 91c6f69a57d4528e749c79f03a0cf2623eca23ab Mon Sep 17 00:00:00 2001 From: Gilbishkosma Date: Sun, 3 Nov 2019 19:51:56 +0530 Subject: [PATCH 382/507] Update deployment-with-docker.rst --- docs/deployment-with-docker.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 038778cf..0df50ff4 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -152,6 +152,7 @@ If you are using ``supervisor``, you can use this file as a starting point:: Move it to ``/etc/supervisor/conf.d/{{cookiecutter.project_slug}}.conf`` and run:: supervisorctl reread + supervisorctl update supervisorctl start {{cookiecutter.project_slug}} For status check, run:: From 8f74fdb9423d34c6674b2737d0ddb879eafddffb Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 4 Nov 2019 12:00:33 +0100 Subject: [PATCH 383/507] Update django from 2.2.6 to 2.2.7 --- {{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 b7596f81..dbdee176 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.6 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.7 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth From cbbbf351d033184c8b6557f5f79c7bcc050b00ca Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 4 Nov 2019 12:34:43 +0000 Subject: [PATCH 384/507] Update CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 8a1d9c45..ae4022d5 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -113,6 +113,7 @@ Listed in alphabetical order. Florian Idelberger `@step21`_ @windrush Garry Cairns `@garry-cairns`_ Garry Polley `@garrypolley`_ + Gilbishkosma `@Gilbishkosma`_ Hamish Durkin `@durkode`_ Hana Quadara `@hanaquadara`_ Harry Percival `@hjwp`_ @@ -269,6 +270,7 @@ Listed in alphabetical order. .. _@foarsitter: https://github.com/foarsitter .. _@garry-cairns: https://github.com/garry-cairns .. _@garrypolley: https://github.com/garrypolley +.. _@Gilbishkosma: https://github.com/Gilbishkosma .. _@glasslion: https://github.com/glasslion .. _@goldhand: https://github.com/goldhand .. _@hackebrot: https://github.com/hackebrot From 9e58bb4e80762cd250feb9b783c990cc482d2375 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 5 Nov 2019 12:00:32 +0100 Subject: [PATCH 385/507] Update pylint-django from 2.0.11 to 2.0.12 --- {{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 e011da63..baee3196 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.8 # https://github.com/PyCQA/flake8 coverage==4.5.4 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/ambv/black -pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.12 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From 66c4f630a7d122b8db01bec9f50dae0db6a21df5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 6 Nov 2019 12:00:34 +0100 Subject: [PATCH 386/507] Update pytest_cases from 1.11.4 to 1.11.5 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 13398eb3..66786b19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.0 pytest==5.2.2 -pytest_cases==1.11.4 +pytest_cases==1.11.5 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.1.2 From 0374f11d099930fa3efd2be278f4d4ffa9dcede7 Mon Sep 17 00:00:00 2001 From: Yuchen Xie <4576282+mapx@users.noreply.github.com> Date: Thu, 7 Nov 2019 18:59:23 +0800 Subject: [PATCH 387/507] Using WhiteNoise in development --- {{cookiecutter.project_slug}}/config/settings/base.py | 3 +++ {{cookiecutter.project_slug}}/config/settings/local.py | 8 ++++++++ .../config/settings/production.py | 9 +-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 41f0f46c..935a0d12 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -131,6 +131,9 @@ AUTH_PASSWORD_VALIDATORS = [ # https://docs.djangoproject.com/en/dev/ref/settings/#middleware MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", +{%- if cookiecutter.use_whitenoise == 'y' %} + "whitenoise.middleware.WhiteNoiseMiddleware", +{%- endif %} "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.locale.LocaleMiddleware", "django.middleware.common.CommonMiddleware", diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index 2ab0a7cb..015d8aff 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -42,6 +42,14 @@ EMAIL_BACKEND = env( ) {%- endif %} +{%- if cookiecutter.use_whitenoise == 'y' %} + +# WhiteNoise +# ------------------------------------------------------------------------------ +# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development +INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405 +{% endif %} + # django-debug-toolbar # ------------------------------------------------------------------------------ # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 712f2bf4..22a2acae 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -194,14 +194,7 @@ ANYMAIL = { "MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"), } -{% if cookiecutter.use_whitenoise == 'y' -%} -# WhiteNoise -# ------------------------------------------------------------------------------ -# http://whitenoise.evans.io/en/latest/django.html#enable-whitenoise -MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # noqa F405 - -{% endif %} -{%- if cookiecutter.use_compressor == 'y' -%} +{% if cookiecutter.use_compressor == 'y' -%} # django-compressor # ------------------------------------------------------------------------------ # https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED From 8a1ec53a74cb2cf11ad2405d8d21db14a224cc74 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 9 Nov 2019 11:00:30 +0000 Subject: [PATCH 388/507] Update gunicorn from 19.9.0 to 20.0.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 d65a0cbc..8d32e81a 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -2,7 +2,7 @@ -r ./base.txt -gunicorn==19.9.0 # https://github.com/benoitc/gunicorn +gunicorn==20.0.0 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==1.3.1 # https://github.com/antonagestam/collectfast From eeda7dfe33c2bd390d5a784cd4f03251c1302001 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 9 Nov 2019 11:00:33 +0000 Subject: [PATCH 389/507] Update sentry-sdk from 0.13.1 to 0.13.2 --- {{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 d65a0cbc..c1fdd2a3 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.1 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.2 # https://github.com/getsentry/sentry-python {%- endif %} # Django From fd5e9be58bd6ff1feea5c5edeae603614f3e6d2e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 9 Nov 2019 11:00:37 +0000 Subject: [PATCH 390/507] Update pytest-django from 3.6.0 to 3.7.0 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index baee3196..4a1c4209 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -33,4 +33,4 @@ factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==2.0 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin -pytest-django==3.6.0 # https://github.com/pytest-dev/pytest-django +pytest-django==3.7.0 # https://github.com/pytest-dev/pytest-django From a38c61369e0b9fc2864b137976c49f4697b199aa Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 12 Nov 2019 11:00:32 +0000 Subject: [PATCH 391/507] Update django-debug-toolbar from 2.0 to 2.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 4a1c4209..2f7234bc 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -30,7 +30,7 @@ pre-commit==1.20.0 # https://github.com/pre-commit/pre-commit # ------------------------------------------------------------------------------ factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy -django-debug-toolbar==2.0 # https://github.com/jazzband/django-debug-toolbar +django-debug-toolbar==2.1 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.7.0 # https://github.com/pytest-dev/pytest-django From 9a3391a6eb1a54fc150a9c5f9edea347b87865dc Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 12 Nov 2019 14:05:30 +0000 Subject: [PATCH 392/507] Update image in README closes #2282 --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4be3c4bc..2fba0979 100644 --- a/README.rst +++ b/README.rst @@ -108,7 +108,7 @@ Projects that provide financial support to the maintainers: Two Scoops of Django 1.11 ~~~~~~~~~~~~~~~~~~~~~~~~~ -.. image:: https://cdn.shopify.com/s/files/1/0304/6901/products/tsd-111-alpha_medium.jpg?v=1499531513 +.. image:: https://cdn.shopify.com/s/files/1/0304/6901/products/2017-06-29-tsd11-sticker-02.png :name: Two Scoops of Django 1.11 Cover :align: center :alt: Two Scoops of Django From ff0122acd6de47b43be6ebf251180261483b1588 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Wed, 13 Nov 2019 23:28:38 +0100 Subject: [PATCH 393/507] Use pytest-django --reuse-db for faster tests Pytest-django allows you to re-use database setups between tests for quicker test runs. This is especially useful for large projects with many migrations. For example, here's a project of mine with 40+ migrations: with --reuse-db ``` pytest --reuse-db 2.54s user 0.35s system 108% cpu 2.669 total ``` without --reuse-db ``` pytest 7.40s user 0.34s system 50% cpu 15.240 total ``` Caveat: if your model happens to change you need to manually --create-db to ensure migrations are applied. https://pytest-django.readthedocs.io/en/latest/database.html#reuse-db-reuse-the-testing-database-between-test-runs --- {{cookiecutter.project_slug}}/pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/pytest.ini b/{{cookiecutter.project_slug}}/pytest.ini index 52b48ab0..e3b2248d 100644 --- a/{{cookiecutter.project_slug}}/pytest.ini +++ b/{{cookiecutter.project_slug}}/pytest.ini @@ -1,5 +1,5 @@ [pytest] -addopts = --ds=config.settings.test +addopts = --ds=config.settings.test --reuse-db python_files = tests.py test_*.py {%- if cookiecutter.js_task_runner != 'None' %} norecursedirs = node_modules From ecb2b259947db3bc5cd6ca67114473a63b16aad3 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 13 Nov 2019 15:22:52 -0800 Subject: [PATCH 394/507] Update tox from 3.14.0 to 3.14.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 66786b19..451d4281 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ -tox==3.14.0 +tox==3.14.1 pytest==5.2.2 pytest_cases==1.11.5 pytest-cookies==0.4.0 From 7a9f133fc3cd8a6fafb069b3614d0763adcc1fb1 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 15 Nov 2019 11:00:32 +0000 Subject: [PATCH 395/507] Update pytest from 5.2.2 to 5.2.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 451d4281..eccaa000 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.1 -pytest==5.2.2 +pytest==5.2.3 pytest_cases==1.11.5 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From 0bd04dd5b30dfe885dcc38f45a3f9a11b04928d5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 15 Nov 2019 11:00:33 +0000 Subject: [PATCH 396/507] Update pytest from 5.2.2 to 5.2.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 2f7234bc..d338f929 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.740 # https://github.com/python/mypy -pytest==5.2.2 # https://github.com/pytest-dev/pytest +pytest==5.2.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 44e404845b050afa8607e3ade1626c95bf7cf962 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 16 Nov 2019 11:00:31 +0000 Subject: [PATCH 397/507] Update pytest from 5.2.3 to 5.2.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index eccaa000..966c944a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.1 -pytest==5.2.3 +pytest==5.2.4 pytest_cases==1.11.5 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From 526f135e85596fe873f458ab799383d85f19b356 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 16 Nov 2019 11:00:32 +0000 Subject: [PATCH 398/507] Update pytest from 5.2.3 to 5.2.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 d338f929..bc8e6651 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.740 # https://github.com/python/mypy -pytest==5.2.3 # https://github.com/pytest-dev/pytest +pytest==5.2.4 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 7a6bbcb0835bef80d0f2fb52d5df27ef9a2d3c8e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 18 Nov 2019 11:00:42 +0000 Subject: [PATCH 399/507] Update pytest_cases from 1.11.5 to 1.11.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 966c944a..9a3d9888 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.1 pytest==5.2.4 -pytest_cases==1.11.5 +pytest_cases==1.11.7 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.1.2 From 5a7e6671d6050fd620d24c73486aee50d0a1372e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 20 Nov 2019 11:00:33 +0000 Subject: [PATCH 400/507] Update pytest from 5.2.4 to 5.3.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9a3d9888..73c787dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.1 -pytest==5.2.4 +pytest==5.3.0 pytest_cases==1.11.7 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From cdd9205075eea1631f86522e210fd245daf88335 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 20 Nov 2019 11:00:35 +0000 Subject: [PATCH 401/507] Update pytest from 5.2.4 to 5.3.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 bc8e6651..61ab281f 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.740 # https://github.com/python/mypy -pytest==5.2.4 # https://github.com/pytest-dev/pytest +pytest==5.3.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 4daf3b9769203f21d9a16e0a546f0eafecf2f454 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Nov 2019 11:00:33 +0000 Subject: [PATCH 402/507] Update django-storages from 1.7.2 to 1.8 --- {{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 d5012532..c89de8f0 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -14,7 +14,7 @@ sentry-sdk==0.13.2 # https://github.com/getsentry/sentry-python # Django # ------------------------------------------------------------------------------ {%- if cookiecutter.cloud_provider == 'AWS' %} -django-storages[boto3]==1.7.2 # https://github.com/jschneier/django-storages +django-storages[boto3]==1.8 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCP' %} django-storages[google]==1.7.2 # https://github.com/jschneier/django-storages {%- endif %} From 9481a5a39097d010daa44e57d28e71247b2bc357 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 21 Nov 2019 11:00:34 +0000 Subject: [PATCH 403/507] Update django-storages from 1.7.2 to 1.8 --- {{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 c89de8f0..e20dff51 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,6 +16,6 @@ sentry-sdk==0.13.2 # https://github.com/getsentry/sentry-python {%- if cookiecutter.cloud_provider == 'AWS' %} django-storages[boto3]==1.8 # https://github.com/jschneier/django-storages {%- elif cookiecutter.cloud_provider == 'GCP' %} -django-storages[google]==1.7.2 # https://github.com/jschneier/django-storages +django-storages[google]==1.8 # https://github.com/jschneier/django-storages {%- endif %} django-anymail[mailgun]==7.0.0 # https://github.com/anymail/django-anymail From 528027f2b0f2f6e7374ca660466c25cf00bdef5e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 23 Nov 2019 11:00:30 +0000 Subject: [PATCH 404/507] Update pytest_cases from 1.11.7 to 1.11.8 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73c787dd..18f2e122 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.8 # ------------------------------------------------------------------------------ tox==3.14.1 pytest==5.3.0 -pytest_cases==1.11.7 +pytest_cases==1.11.8 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.1.2 From b014121810e3332acbb15ba98e57e859086b0fb7 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 23 Nov 2019 11:00:33 +0000 Subject: [PATCH 405/507] Update gunicorn from 20.0.0 to 20.0.2 --- {{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 e20dff51..93116cbd 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -2,7 +2,7 @@ -r ./base.txt -gunicorn==20.0.0 # https://github.com/benoitc/gunicorn +gunicorn==20.0.2 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==1.3.1 # https://github.com/antonagestam/collectfast From 09d95d8ab464498bc28ef5755637ed378bb1aca3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 23 Nov 2019 11:00:37 +0000 Subject: [PATCH 406/507] Update django-crispy-forms from 1.8.0 to 1.8.1 --- {{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 dbdee176..6ca90421 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ django==2.2.7 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth -django-crispy-forms==1.8.0 # https://github.com/django-crispy-forms/django-crispy-forms +django-crispy-forms==1.8.1 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.3 # https://github.com/django-compressor/django-compressor {%- endif %} From dce02bae70f6681c88b0d3bad92ae30a6cc9e9f3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 24 Nov 2019 11:00:31 +0000 Subject: [PATCH 407/507] Update pylint-django from 2.0.12 to 2.0.13 --- {{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 61ab281f..5cfcce2b 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.8 # https://github.com/PyCQA/flake8 coverage==4.5.4 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/ambv/black -pylint-django==2.0.12 # https://github.com/PyCQA/pylint-django +pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} From fbd0fcbb6104cfcf84a70dcb7f45ee2152a8df66 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 25 Nov 2019 11:00:33 +0000 Subject: [PATCH 408/507] Update sentry-sdk from 0.13.2 to 0.13.3 --- {{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 e20dff51..4722ce9c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.2 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.3 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 82c8b5127226398c537fba897437c62cfdf0c622 Mon Sep 17 00:00:00 2001 From: Harry Moreno Date: Mon, 25 Nov 2019 16:43:30 -0500 Subject: [PATCH 409/507] Make update form button look like a button without `ban-primary` the button looks like some floating text. --- .../templates/users/user_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html index 6a86a273..e9da0d48 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_form.html @@ -10,7 +10,7 @@ {{ form|crispy }}
- +
From 832275a792b2ae0899b68bdacb75fa5ce6a34d2d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 26 Nov 2019 11:00:32 +0000 Subject: [PATCH 410/507] Update gunicorn from 20.0.2 to 20.0.3 --- {{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 846cb578..c0a66efc 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -2,7 +2,7 @@ -r ./base.txt -gunicorn==20.0.2 # https://github.com/benoitc/gunicorn +gunicorn==20.0.3 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==1.3.1 # https://github.com/antonagestam/collectfast From 2a25e523e547d96dd0a6b40fc1acf554dffeffe4 Mon Sep 17 00:00:00 2001 From: Harry Moreno Date: Tue, 26 Nov 2019 14:51:48 -0500 Subject: [PATCH 411/507] Add self to contributors.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 56416abf..53edb28e 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -116,6 +116,7 @@ Listed in alphabetical order. Gilbishkosma `@Gilbishkosma`_ Hamish Durkin `@durkode`_ Hana Quadara `@hanaquadara`_ + Harry Moreno `@morenoh149`_ @morenoh149 Harry Percival `@hjwp`_ Hendrik Schneider `@hendrikschneider`_ Henrique G. G. Pereira `@ikkebr`_ @@ -307,6 +308,7 @@ Listed in alphabetical order. .. _@minho42: https://github.com/minho42 .. _@mjsisley: https://github.com/mjsisley .. _@mknapper1: https://github.com/mknapper1 +.. _@morenoh149: https://github.com/morenoh149 .. _@mostaszewski: https://github.com/mostaszewski .. _@mozillazg: https://github.com/mozillazg .. _@mrcoles: https://github.com/mrcoles From a1669324e8c535be925557bc555b11e77e838b94 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 27 Nov 2019 02:41:09 -0800 Subject: [PATCH 412/507] Update pytest from 5.3.0 to 5.3.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 18f2e122..5f7c2e32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ tox==3.14.1 -pytest==5.3.0 +pytest==5.3.1 pytest_cases==1.11.8 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From 6a302ec703b28ce2393480123432fe39560a9cb6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 27 Nov 2019 11:00:34 +0000 Subject: [PATCH 413/507] Update gunicorn from 20.0.3 to 20.0.4 --- {{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 c0a66efc..7be7f97c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -2,7 +2,7 @@ -r ./base.txt -gunicorn==20.0.3 # https://github.com/benoitc/gunicorn +gunicorn==20.0.4 # https://github.com/benoitc/gunicorn psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==1.3.1 # https://github.com/antonagestam/collectfast From 4283ca76a4b53b33c7fbf272f87abe888cc183ba Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 27 Nov 2019 11:00:38 +0000 Subject: [PATCH 414/507] Update sentry-sdk from 0.13.3 to 0.13.4 --- {{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 c0a66efc..850d1f02 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.3 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.4 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 9ec808e7f415c9bda68caec167e3f722ce743ab1 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 28 Nov 2019 11:00:32 +0000 Subject: [PATCH 415/507] Update pytest from 5.3.0 to 5.3.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 5cfcce2b..3ebc2320 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.740 # https://github.com/python/mypy -pytest==5.3.0 # https://github.com/pytest-dev/pytest +pytest==5.3.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From c76b3066d63efd45f62d4d9db43a19f4bd98c441 Mon Sep 17 00:00:00 2001 From: Denis Savran Date: Thu, 28 Nov 2019 23:16:06 +0300 Subject: [PATCH 416/507] Upgrade to Traefik v2 --- CONTRIBUTORS.rst | 2 + .../compose/production/traefik/Dockerfile | 4 +- .../compose/production/traefik/traefik.toml | 41 ------------ .../compose/production/traefik/traefik.yml | 67 +++++++++++++++++++ 4 files changed, 71 insertions(+), 43 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml create mode 100644 {{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 53edb28e..46afc393 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -102,6 +102,7 @@ Listed in alphabetical order. Demetris Stavrou `@demestav`_ Denis Bobrov `@delneg`_ Denis Orehovsky `@apirobot`_ + Denis Savran `@blaxpy`_ Diane Chen `@purplediane`_ @purplediane88 Dónal Adams `@epileptic-fish`_ Dong Huynh `@trungdong`_ @@ -226,6 +227,7 @@ Listed in alphabetical order. .. _@arruda: https://github.com/arruda .. _@bertdemiranda: https://github.com/bertdemiranda .. _@bittner: https://github.com/bittner +.. _@blaxpy: https://github.com/blaxpy .. _@bloodpet: https://github.com/bloodpet .. _@blopker: https://github.com/blopker .. _@bogdal: https://github.com/bogdal diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile index d7363a1a..746aa2b4 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/Dockerfile @@ -1,5 +1,5 @@ -FROM traefik:1.7-alpine +FROM traefik:v2.0 RUN mkdir -p /etc/traefik/acme RUN touch /etc/traefik/acme/acme.json RUN chmod 600 /etc/traefik/acme/acme.json -COPY ./compose/production/traefik/traefik.toml /etc/traefik +COPY ./compose/production/traefik/traefik.yml /etc/traefik diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml deleted file mode 100644 index 0f2abe8a..00000000 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.toml +++ /dev/null @@ -1,41 +0,0 @@ -logLevel = "INFO" -defaultEntryPoints = ["http", "https"] - -# Entrypoints, http and https -[entryPoints] - # http should be redirected to https - [entryPoints.http] - address = ":80" - [entryPoints.http.redirect] - entryPoint = "https" - # https is the default - [entryPoints.https] - address = ":443" - [entryPoints.https.tls] - -# Enable ACME (Let's Encrypt): automatic SSL -[acme] -# Email address used for registration -email = "{{ cookiecutter.email }}" -storage = "/etc/traefik/acme/acme.json" -entryPoint = "https" -onDemand = false -OnHostRule = true - # Use a HTTP-01 acme challenge rather than TLS-SNI-01 challenge - [acme.httpChallenge] - entryPoint = "http" - -[file] -[backends] - [backends.django] - [backends.django.servers.server1] - url = "http://django:5000" - -[frontends] - [frontends.django] - backend = "django" - passHostHeader = true - [frontends.django.headers] - HostsProxyHeaders = ['X-CSRFToken'] - [frontends.django.routes.dr1] - rule = "Host:{{ cookiecutter.domain_name }}" diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml new file mode 100644 index 00000000..324c62af --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml @@ -0,0 +1,67 @@ +log: + level: INFO + +entryPoints: + web: + # http + address: ":80" + + web-secure: + # https + address: ":443" + +certificatesResolvers: + letsencrypt: + # https://docs.traefik.io/master/https/acme/#lets-encrypt + acme: + email: "{{ cookiecutter.email }}" + storage: /etc/traefik/acme/acme.json + # https://docs.traefik.io/master/https/acme/#httpchallenge + httpChallenge: + entryPoint: web + +http: + routers: + web-router: + rule: "Host(`{{ cookiecutter.domain_name }}`)" + entryPoints: + - web + middlewares: + - redirect + - csrf + service: django + + web-secure-router: + rule: "Host(`{{ cookiecutter.domain_name }}`)" + entryPoints: + - web-secure + middlewares: + - csrf + service: django + tls: + # https://docs.traefik.io/master/routing/routers/#certresolver + certResolver: letsencrypt + + middlewares: + redirect: + # https://docs.traefik.io/master/middlewares/redirectscheme/ + redirectScheme: + scheme: https + permanent: true + csrf: + # https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders + # https://docs.djangoproject.com/en/dev/ref/csrf/#ajax + headers: + hostsProxyHeaders: ['X-CSRFToken'] + + services: + django: + loadBalancer: + servers: + - url: http://django:5000 + +providers: + # https://docs.traefik.io/master/providers/file/ + file: + filename: /etc/traefik/traefik.yml + watch: true From 1453b328916de4c78fbcdd85513eac83004823a1 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 30 Nov 2019 11:00:31 +0000 Subject: [PATCH 417/507] Update mypy from 0.740 to 0.750 --- {{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 5cfcce2b..df378239 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.740 # https://github.com/python/mypy +mypy==0.750 # https://github.com/python/mypy pytest==5.3.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From b638ce0a1b523de0c38a576db4829c584d41d6f4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 2 Dec 2019 11:00:31 +0000 Subject: [PATCH 418/507] Update django from 2.2.7 to 2.2.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 6ca90421..6ac35587 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.7 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.8 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth From 2214951bbe298d51343f8ee5f743c35e8a6736a9 Mon Sep 17 00:00:00 2001 From: Jelmert Date: Tue, 3 Dec 2019 11:19:01 +0100 Subject: [PATCH 419/507] updated werkzeug from 0.14.1 to 0.16.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 3ebc2320..d4453daa 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.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug +Werkzeug==0.16.0 # https://github.com/pallets/werkzeug ipdb==0.12.2 # https://github.com/gotcha/ipdb Sphinx==2.2.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From 4a185510e317eceb721ca322c947a865a36225c5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 3 Dec 2019 11:00:33 +0000 Subject: [PATCH 420/507] Update tox from 3.14.1 to 3.14.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5f7c2e32..ffde9100 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.8 # Testing # ------------------------------------------------------------------------------ -tox==3.14.1 +tox==3.14.2 pytest==5.3.1 pytest_cases==1.11.8 pytest-cookies==0.4.0 From a7ed8e9fee2a478f3769c3a309d6320c1e6c350c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 3 Dec 2019 11:00:37 +0000 Subject: [PATCH 421/507] Update pyyaml from 5.1.2 to 5.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5f7c2e32..b032f217 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,4 @@ pytest==5.3.1 pytest_cases==1.11.8 pytest-cookies==0.4.0 pytest-xdist==1.30.0 -pyyaml==5.1.2 +pyyaml==5.2 From 3140fe74cabf27e28a8b0acd33e1efe9ef2559e3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 3 Dec 2019 11:00:42 +0000 Subject: [PATCH 422/507] Update sphinx from 2.2.1 to 2.2.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 3ebc2320..4fd01d7c 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.2 # https://github.com/gotcha/ipdb -Sphinx==2.2.1 # https://github.com/sphinx-doc/sphinx +Sphinx==2.2.2 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From 79da1482a533201267d69cb789cbde8a62748e63 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 3 Dec 2019 08:01:37 -0800 Subject: [PATCH 423/507] Update flake8 from 3.7.8 to 3.7.9 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4a75eef5..ab1451d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ black==19.10b0 -flake8==3.7.8 +flake8==3.7.9 # Testing # ------------------------------------------------------------------------------ From 112972d881159f5dbc468013cec331a0f715aecf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 4 Dec 2019 11:00:32 +0000 Subject: [PATCH 424/507] Update ipdb from 0.12.2 to 0.12.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 28bcb4a5..6f19183f 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ -r ./base.txt Werkzeug==0.16.0 # https://github.com/pallets/werkzeug -ipdb==0.12.2 # https://github.com/gotcha/ipdb +ipdb==0.12.3 # https://github.com/gotcha/ipdb Sphinx==2.2.2 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 From e7923c6c5c0750b8823e260f63d16b82a137271e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 4 Dec 2019 11:00:35 +0000 Subject: [PATCH 425/507] Update flake8 from 3.7.8 to 3.7.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 28bcb4a5..aa740145 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.8 # https://github.com/PyCQA/flake8 +flake8==3.7.9 # https://github.com/PyCQA/flake8 coverage==4.5.4 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/ambv/black pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django From 113ce88d9cc9b7af133d114d551af93a509e7774 Mon Sep 17 00:00:00 2001 From: Ivan Khomutov Date: Fri, 6 Dec 2019 10:55:00 +0300 Subject: [PATCH 426/507] Add option to choose CI tool --- cookiecutter.json | 6 +++- docs/project-generation-options.rst | 11 +++++-- hooks/post_gen_project.py | 11 +++++-- tests/test_cookiecutter_generation.py | 20 +++++++++++- {{cookiecutter.project_slug}}/.gitlab-ci.yml | 33 ++++++++++++++++++++ 5 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/.gitlab-ci.yml diff --git a/cookiecutter.json b/cookiecutter.json index d6d217ca..6d030be0 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -40,7 +40,11 @@ "use_sentry": "n", "use_whitenoise": "n", "use_heroku": "n", - "use_travisci": "n", + "ci_tool": [ + "None", + "Travis", + "Gitlab" + ], "keep_local_envs_in_vcs": "y", "debug": "n" diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index afa9b8af..ae47b097 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -94,8 +94,12 @@ use_heroku: Indicates whether the project should be configured so as to be deployable to Heroku_. -use_travisci: - Indicates whether the project should be configured to use `Travis CI`_. +ci_tool: + Select a CI tool for running tests. The choices are: + + 1. None + 2. Travis_ + 3. Gitlab_ keep_local_envs_in_vcs: Indicates whether the project's ``.envs/.local/`` should be kept in VCS @@ -138,3 +142,6 @@ debug: .. _Heroku: https://github.com/heroku/heroku-buildpack-python .. _Travis CI: https://travis-ci.org/ + +.. _GitLab CI: https://docs.gitlab.com/ee/ci/ + diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 0544f14b..79c32f9b 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -70,7 +70,7 @@ def remove_heroku_files(): for file_name in file_names: if ( file_name == "requirements.txt" - and "{{ cookiecutter.use_travisci }}".lower() == "y" + and "{{ cookiecutter.ci_tool }}".lower() == "travis" ): # don't remove the file if we are using travisci but not using heroku continue @@ -105,6 +105,10 @@ def remove_dottravisyml_file(): os.remove(".travis.yml") +def remove_dotgitlabciyml_file(): + os.remove(".gitlab-ci.yml") + + def append_to_project_gitignore(path): gitignore_file_path = ".gitignore" with open(gitignore_file_path, "a") as gitignore_file: @@ -349,9 +353,12 @@ def main(): if "{{ cookiecutter.use_docker }}".lower() == "y": remove_celery_compose_dirs() - if "{{ cookiecutter.use_travisci }}".lower() == "n": + if "{{ cookiecutter.ci_tool }}".lower() != "travis": remove_dottravisyml_file() + if "{{ cookiecutter.ci_tool }}".lower() != "gitlab": + remove_dotgitlabciyml_file() + print(SUCCESS + "Project initialized, keep up the good work!" + TERMINATOR) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index f931bce0..8c2f71fe 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -140,7 +140,7 @@ def test_black_passes(cookies, context_combination): def test_travis_invokes_pytest(cookies, context): - context.update({"use_travisci": "y"}) + context.update({"ci_tool": "Travis"}) result = cookies.bake(extra_context=context) assert result.exit_code == 0 @@ -155,6 +155,24 @@ def test_travis_invokes_pytest(cookies, context): pytest.fail(e) +def test_gitlab_invokes_flake8_and_pytest(cookies, context): + context.update({"ci_tool": "Gitlab"}) + result = cookies.bake(extra_context=context) + + assert result.exit_code == 0 + assert result.exception is None + assert result.project.basename == context["project_slug"] + assert result.project.isdir() + + with open(f"{result.project}/.gitlab-ci.yml", "r") as gitlab_yml: + try: + gitlab_config = yaml.load(gitlab_yml) + assert gitlab_config["flake8"]["script"] == ["flake8"] + assert gitlab_config["pytest"]["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.""" diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml new file mode 100644 index 00000000..15ff73b1 --- /dev/null +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -0,0 +1,33 @@ +stages: + - lint + - test + +variables: + POSTGRES_USER: '{{ cookiecutter.project_slug }}' + POSTGRES_PASSWORD: '' + POSTGRES_DB: 'test_{{ cookiecutter.project_slug }}' + +flake8: + stage: lint + image: python:3.7-alpine + before_script: + - pip install -q flake8 + script: + - flake8 + +pytest: + stage: test + image: python:3.7 + tags: + - docker + services: + - postgres:11 + variables: + DATABASE_URL: pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB + + before_script: + - pip install -r requirements/local.txt + + script: + - pytest + From 97880e5046a4af5f2042a7c6144e012fe6e2e356 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 6 Dec 2019 11:00:30 +0000 Subject: [PATCH 427/507] Update sentry-sdk from 0.13.4 to 0.13.5 --- {{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 69217ab3..438ccca6 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.4 # https://github.com/getsentry/sentry-python +sentry-sdk==0.13.5 # https://github.com/getsentry/sentry-python {%- endif %} # Django From a88b6b04b6c13b2d9f7f7f794680326786632a3b Mon Sep 17 00:00:00 2001 From: Yuchen Xie <4576282+mapx@users.noreply.github.com> Date: Mon, 9 Dec 2019 09:55:37 +0800 Subject: [PATCH 428/507] Speed up django image build process, and reduce its size --- .../compose/production/django/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index b0861d60..e63241f4 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -57,13 +57,11 @@ RUN chmod +x /start-flower {%- endif %} {%- if cookiecutter.js_task_runner == 'Gulp' %} -COPY --from=client-builder /app /app +COPY --from=client-builder --chown=django:django /app /app {% else %} -COPY . /app +COPY --chown=django:django . /app {%- endif %} -RUN chown -R django /app - USER django WORKDIR /app From 1dd8608142e7deadb943f4805dd13f9399a8330d Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Tue, 10 Dec 2019 12:46:52 +0100 Subject: [PATCH 429/507] Add django.middleware.common.BrokenLinkEmailsMiddleware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://docs.djangoproject.com/en/2.2/howto/error-reporting/#errors > If those conditions are met, Django will email the users listed in the > MANAGERS setting whenever your code raises a 404 and the request has a > referer. It doesn’t bother to email for 404s that don’t have a referer – > those are usually just people typing in broken URLs or broken Web bots. > It also ignores 404s when the referer is equal to the requested URL, > since this behavior is from broken Web bots too. --- {{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 935a0d12..ecfeed7a 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -140,6 +140,7 @@ MIDDLEWARE = [ "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.common.BrokenLinkEmailsMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", ] From 0f515974cb85e1c948bbdaae7874fd853ce35e56 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Wed, 11 Dec 2019 14:58:21 +0100 Subject: [PATCH 430/507] Remove mypy defaults and set django-stubs setting https://mypy.readthedocs.io/en/latest/config_file.html ignore_errors = False strict_optional = True Are both set to these values by default. No need to set them in the config. ```toml [mypy.plugins.django-stubs] django_settings_module = config.settings.local ``` mypy.plugins.django-stubs requires django_settings_module to be set. https://github.com/typeddjango/django-stubs#configuration --- {{cookiecutter.project_slug}}/setup.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index 42b63861..f7cd01cb 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -9,13 +9,14 @@ exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules [mypy] python_version = 3.7 check_untyped_defs = True -ignore_errors = False ignore_missing_imports = True -strict_optional = True warn_unused_ignores = True warn_redundant_casts = True warn_unused_configs = True +[mypy.plugins.django-stubs] +django_settings_module = config.settings.test + [mypy-*.migrations.*] # Django migrations should not produce any errors: ignore_errors = True From 37bc459796103b7ba0ea6b5009f516b507d1fc0f Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 12 Dec 2019 08:00:31 -0300 Subject: [PATCH 431/507] Update pytest_cases from 1.11.8 to 1.11.9 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ab1451d3..8cd8c53a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.9 # ------------------------------------------------------------------------------ tox==3.14.2 pytest==5.3.1 -pytest_cases==1.11.8 +pytest_cases==1.11.9 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.2 From c59062a496fb07033308dc8a845988fb98fe60ae Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 12 Dec 2019 08:00:35 -0300 Subject: [PATCH 432/507] Update django-model-utils from 3.2.0 to 4.0.0 --- {{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 6ac35587..c195e796 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -21,7 +21,7 @@ flower==0.9.3 # https://github.com/mher/flower # ------------------------------------------------------------------------------ django==2.2.8 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ -django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils +django-model-utils==4.0.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth django-crispy-forms==1.8.1 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} From d4189097146b04db04a2430f62cd43f7fbd04a6c Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 13 Dec 2019 08:00:31 -0300 Subject: [PATCH 433/507] Update whitenoise from 4.1.4 to 5.0.1 --- {{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 6ac35587..9d930428 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -6,7 +6,7 @@ rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == ' {%- endif %} argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} -whitenoise==4.1.4 # https://github.com/evansd/whitenoise +whitenoise==5.0.1 # https://github.com/evansd/whitenoise {%- endif %} redis==3.3.11 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} From 6ce4b13d83257572a6f12abd9075e0d74475f7e6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 13 Dec 2019 08:00:36 -0300 Subject: [PATCH 434/507] Update djangorestframework from 3.10.3 to 3.11.0 --- {{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 6ac35587..1eaca3d3 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,5 +30,5 @@ django-compressor==2.3 # https://github.com/django-compressor/django-compressor django-redis==4.10.0 # https://github.com/niwinz/django-redis # Django REST Framework -djangorestframework==3.10.3 # https://github.com/encode/django-rest-framework +djangorestframework==3.11.0 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client From d085a9c43236f2f821c32317d5da3da2c8b4bfa4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 14 Dec 2019 08:00:29 -0300 Subject: [PATCH 435/507] Update django-redis from 4.10.0 to 4.11.0 --- {{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 69869e14..926a02c0 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -27,7 +27,7 @@ django-crispy-forms==1.8.1 # https://github.com/django-crispy-forms/django-cris {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.3 # https://github.com/django-compressor/django-compressor {%- endif %} -django-redis==4.10.0 # https://github.com/niwinz/django-redis +django-redis==4.11.0 # https://github.com/niwinz/django-redis # Django REST Framework djangorestframework==3.11.0 # https://github.com/encode/django-rest-framework From 32e42cb0ec38839fec378757755c7f94f3be065d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 15 Dec 2019 02:56:41 -0800 Subject: [PATCH 436/507] Update pytest from 5.3.1 to 5.3.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8cd8c53a..0a2c0639 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.9 # Testing # ------------------------------------------------------------------------------ tox==3.14.2 -pytest==5.3.1 +pytest==5.3.2 pytest_cases==1.11.9 pytest-cookies==0.4.0 pytest-xdist==1.30.0 From b6a524c346a0bd22d7c7b8a7f561ab7bba449343 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sun, 15 Dec 2019 08:00:29 -0300 Subject: [PATCH 437/507] Update coverage from 4.5.4 to 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 5b8f3279..ae112a94 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -18,7 +18,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ flake8==3.7.9 # https://github.com/PyCQA/flake8 -coverage==4.5.4 # https://github.com/nedbat/coveragepy +coverage==5.0 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/ambv/black pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From 8211a83f3a21381060c8767049e676f5cf609ef5 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 16 Dec 2019 08:00:30 -0300 Subject: [PATCH 438/507] Update celery from 4.3.0 to 4.4.0 --- {{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 926a02c0..de4e8252 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -10,7 +10,7 @@ whitenoise==5.0.1 # https://github.com/evansd/whitenoise {%- endif %} redis==3.3.11 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} -celery==4.3.0 # pyup: < 5.0 # https://github.com/celery/celery +celery==4.4.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 From acd63b14b8a1c4d0427c56ffd33bfb4c0b2280b2 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 16 Dec 2019 08:00:34 -0300 Subject: [PATCH 439/507] Update sphinx from 2.2.2 to 2.3.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 ae112a94..1b54f001 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.16.0 # https://github.com/pallets/werkzeug ipdb==0.12.3 # https://github.com/gotcha/ipdb -Sphinx==2.2.2 # https://github.com/sphinx-doc/sphinx +Sphinx==2.3.0 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From 2229a09faccd789ca9dbe9d03f3c1031b522a446 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 18 Dec 2019 08:00:31 -0300 Subject: [PATCH 440/507] Update django from 2.2.8 to 2.2.9 --- {{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 de4e8252..a307b481 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -19,7 +19,7 @@ flower==0.9.3 # https://github.com/mher/flower # Django # ------------------------------------------------------------------------------ -django==2.2.8 # pyup: < 3.0 # https://www.djangoproject.com/ +django==2.2.9 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==4.0.0 # https://github.com/jazzband/django-model-utils django-allauth==0.40.0 # https://github.com/pennersr/django-allauth From 29d2ff0ccfb33b2bb9a8fc4df24bda409a582b48 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 18 Dec 2019 08:00:35 -0300 Subject: [PATCH 441/507] Update mypy from 0.750 to 0.760 --- {{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 1b54f001..2d333b5c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.750 # https://github.com/python/mypy +mypy==0.760 # https://github.com/python/mypy pytest==5.3.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From 2b0027de71df7d0bae08afc25c5037e6a1896619 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 19 Dec 2019 08:00:30 -0300 Subject: [PATCH 442/507] Update django-allauth from 0.40.0 to 0.41.0 --- {{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 a307b481..c31481a3 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -22,7 +22,7 @@ flower==0.9.3 # https://github.com/mher/flower django==2.2.9 # pyup: < 3.0 # https://www.djangoproject.com/ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==4.0.0 # https://github.com/jazzband/django-model-utils -django-allauth==0.40.0 # https://github.com/pennersr/django-allauth +django-allauth==0.41.0 # https://github.com/pennersr/django-allauth django-crispy-forms==1.8.1 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.3 # https://github.com/django-compressor/django-compressor From 311b96b169252b1025383712c5413c03da3c91a4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 20 Dec 2019 08:00:29 -0300 Subject: [PATCH 443/507] Update pytest_cases from 1.11.9 to 1.12.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0a2c0639..2ba89659 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.9 # ------------------------------------------------------------------------------ tox==3.14.2 pytest==5.3.2 -pytest_cases==1.11.9 +pytest_cases==1.12.0 pytest-cookies==0.4.0 pytest-xdist==1.30.0 pyyaml==5.2 From 85efbda0033f6b4d98a0d58634c6047917eaa444 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 20 Dec 2019 08:00:32 -0300 Subject: [PATCH 444/507] Update pytest-xdist from 1.30.0 to 1.31.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0a2c0639..ba7dae86 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,5 @@ tox==3.14.2 pytest==5.3.2 pytest_cases==1.11.9 pytest-cookies==0.4.0 -pytest-xdist==1.30.0 +pytest-xdist==1.31.0 pyyaml==5.2 From b75cb6e6da32bb3901a44b8b4561e0a916c95b9d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 20 Dec 2019 08:00:35 -0300 Subject: [PATCH 445/507] Update mypy from 0.760 to 0.761 --- {{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 2d333b5c..070a0b2d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -11,7 +11,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ -mypy==0.760 # https://github.com/python/mypy +mypy==0.761 # https://github.com/python/mypy pytest==5.3.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From c7027526a3d295fce9e8b12f5b6e8b1017d789f4 Mon Sep 17 00:00:00 2001 From: David D Date: Sun, 22 Dec 2019 12:52:22 +0100 Subject: [PATCH 446/507] Add Debian 10 (buster) OS dependencies --- .../utility/requirements-buster.apt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/utility/requirements-buster.apt diff --git a/{{cookiecutter.project_slug}}/utility/requirements-buster.apt b/{{cookiecutter.project_slug}}/utility/requirements-buster.apt new file mode 100644 index 00000000..75957f40 --- /dev/null +++ b/{{cookiecutter.project_slug}}/utility/requirements-buster.apt @@ -0,0 +1,23 @@ +##basic build dependencies of various Django apps for Debian Jessie 10.x +#build-essential metapackage install: make, gcc, g++, +build-essential +#required to translate +gettext +python3-dev + +##shared dependencies of: +##Pillow, pylibmc +zlib1g-dev + +##Postgresql and psycopg2 dependencies +libpq-dev + +##Pillow dependencies +libtiff5-dev +libjpeg62-turbo-dev +libfreetype6-dev +liblcms2-dev +libwebp-dev + +##django-extensions +libgraphviz-dev From afc7235d577f312de923bc8019d2906d7babb349 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 22 Dec 2019 19:37:15 -0800 Subject: [PATCH 447/507] Update cookiecutter from 1.6.0 to 1.7.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index eccb2d9d..8f836006 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -cookiecutter==1.6.0 +cookiecutter==1.7.0 sh==1.12.14 binaryornot==0.4.4 From 66991d9e958791f6cbb0946b2e67694286d2b3ab Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 23 Dec 2019 08:00:31 -0300 Subject: [PATCH 448/507] Update sphinx from 2.3.0 to 2.3.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 070a0b2d..89d10373 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,7 +2,7 @@ Werkzeug==0.16.0 # https://github.com/pallets/werkzeug ipdb==0.12.3 # https://github.com/gotcha/ipdb -Sphinx==2.3.0 # https://github.com/sphinx-doc/sphinx +Sphinx==2.3.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} From 16b219034af54784c530fc545079e1ab21c5906a Mon Sep 17 00:00:00 2001 From: howiezhao Date: Sat, 28 Dec 2019 17:26:43 +0800 Subject: [PATCH 449/507] Update docs files --- docs/document.rst | 45 +++ docs/index.rst | 1 + docs/testing.rst | 6 +- {{cookiecutter.project_slug}}/docs/Makefile | 159 +---------- {{cookiecutter.project_slug}}/docs/conf.py | 258 ++---------------- {{cookiecutter.project_slug}}/docs/index.rst | 14 +- {{cookiecutter.project_slug}}/docs/make.bat | 191 ++----------- .../docs/pycharm/configuration.rst | 6 + 8 files changed, 123 insertions(+), 557 deletions(-) create mode 100644 docs/document.rst diff --git a/docs/document.rst b/docs/document.rst new file mode 100644 index 00000000..abf115a1 --- /dev/null +++ b/docs/document.rst @@ -0,0 +1,45 @@ +.. _document: + +Document +========= + +This project uses Sphinx_ documentation generator. +After you have set up to `develop locally`_, run the following commands to generate the HTML documentation: :: + + $ sphinx-build docs/ docs/_build/html/ + +If you set up your project to `develop locally with docker`_, run the following command: :: + + $ docker-compose -f local.yml run --rm django sphinx-build docs/ docs/_build/html/ + +Generate API documentation +---------------------------- + +Sphinx can automatically generate documentation from docstrings, to enable this feature, follow these steps: + +1. Add Sphinx extension in ``docs/conf.py`` file, like below: :: + + extensions = [ + 'sphinx.ext.autodoc', + ] + +2. Uncomment the following lines in the ``docs/conf.py`` file: :: + + # import django + # sys.path.insert(0, os.path.abspath('..')) + # os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") + # django.setup() + +3. Run the following command: :: + + $ sphinx-apidoc -f -o ./docs/modules/ ./tpub/ migrations/* + + If you set up your project to `develop locally with docker`_, run the following command: :: + + $ docker-compose -f local.yml run --rm django sphinx-apidoc -f -o ./docs/modules ./tpub/ migrations/* + +4. Regenerate HTML documentation as written above. + +.. _Sphinx: https://www.sphinx-doc.org/en/master/index.html +.. _develop locally: ../developing-locally.rst +.. _develop locally with docker: ..../developing-locally-docker.rst diff --git a/docs/index.rst b/docs/index.rst index 5cb07b4b..8e0d04aa 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,6 +18,7 @@ Contents: settings linters testing + document deployment-on-pythonanywhere deployment-on-heroku deployment-with-docker diff --git a/docs/testing.rst b/docs/testing.rst index 63cb9e18..cd323e5c 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -19,7 +19,7 @@ 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 --rm django pytest Targeting particular apps for testing in ``docker`` follows a similar pattern as previously shown above. @@ -28,11 +28,11 @@ Coverage You should build your tests to provide the highest level of **code coverage**. You can run the ``pytest`` with code ``coverage`` by typing in the following command: :: - $ docker-compose -f local.yml run django coverage run -m pytest + $ docker-compose -f local.yml run --rm django coverage run -m pytest Once the tests are complete, in order to see the code coverage, run the following command: :: - $ docker-compose -f local.yml run django coverage report + $ docker-compose -f local.yml run --rm django coverage report .. note:: diff --git a/{{cookiecutter.project_slug}}/docs/Makefile b/{{cookiecutter.project_slug}}/docs/Makefile index a5d4ea96..d4bb2cbb 100644 --- a/{{cookiecutter.project_slug}}/docs/Makefile +++ b/{{cookiecutter.project_slug}}/docs/Makefile @@ -1,153 +1,20 @@ -# Makefile for Sphinx documentation +# Minimal makefile for Sphinx documentation # -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . BUILDDIR = _build -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - +# Put it first so that "make" without argument is like "make help". help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -clean: - -rm -rf $(BUILDDIR)/* +.PHONY: help Makefile -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/{{cookiecutter.project_slug}}/docs/conf.py b/{{cookiecutter.project_slug}}/docs/conf.py index 154c3a7a..3c5d84ad 100644 --- a/{{cookiecutter.project_slug}}/docs/conf.py +++ b/{{cookiecutter.project_slug}}/docs/conf.py @@ -1,255 +1,55 @@ -# {{ cookiecutter.project_name }} documentation build configuration file, created by -# sphinx-quickstart. +# Configuration file for the Sphinx documentation builder. # -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html -import os -import sys +# -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('.')) +# +import os +import sys +# import django +# sys.path.insert(0, os.path.abspath('..')) +# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") +# django.setup() -# -- General configuration ----------------------------------------------------- -# If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' +# -- Project information ----------------------------------------------------- -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# The suffix of source filenames. -source_suffix = ".rst" - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. project = "{{ cookiecutter.project_name }}" copyright = """{% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}""" +author = "{{ cookiecutter.author_name }}" -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = "0.1" -# The full version, including alpha/beta/rc tags. -release = "0.1" -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# language = None +# -- General configuration --------------------------------------------------- -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] -# -- Options for HTML output --------------------------------------------------- +# -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "default" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None +# +html_theme = 'alabaster' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = "{{ cookiecutter.project_slug }}doc" - - -# -- Options for LaTeX output -------------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ( - "index", - "{{ cookiecutter.project_slug }}.tex", - "{{ cookiecutter.project_name }} Documentation", - """{{ cookiecutter.author_name }}""", - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - "index", - "{{ cookiecutter.project_slug }}", - "{{ cookiecutter.project_name }} Documentation", - ["""{{ cookiecutter.author_name }}"""], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------------ - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - "index", - "{{ cookiecutter.project_slug }}", - "{{ cookiecutter.project_name }} Documentation", - """{{ cookiecutter.author_name }}""", - "{{ cookiecutter.project_name }}", - """{{ cookiecutter.description }}""", - "Miscellaneous", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' +html_static_path = ['_static'] diff --git a/{{cookiecutter.project_slug}}/docs/index.rst b/{{cookiecutter.project_slug}}/docs/index.rst index 96752d80..b107a9e5 100644 --- a/{{cookiecutter.project_slug}}/docs/index.rst +++ b/{{cookiecutter.project_slug}}/docs/index.rst @@ -3,17 +3,19 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -{{ cookiecutter.project_name }} Project Documentation -==================================================================== - -Table of Contents: +Welcome to {{ cookiecutter.project_name }}'s documentation! +====================================================================== .. toctree:: :maxdepth: 2 + :caption: Contents: + + pycharm/configuration -Indices & Tables -================ + +Indices and tables +================== * :ref:`genindex` * :ref:`modindex` diff --git a/{{cookiecutter.project_slug}}/docs/make.bat b/{{cookiecutter.project_slug}}/docs/make.bat index ec43148b..922152e9 100644 --- a/{{cookiecutter.project_slug}}/docs/make.bat +++ b/{{cookiecutter.project_slug}}/docs/make.bat @@ -1,190 +1,35 @@ @ECHO OFF +pushd %~dp0 + REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) +set SOURCEDIR=. set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) if "%1" == "" goto help -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 ) -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end +popd diff --git a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst index c1d4f4b9..1c20d023 100644 --- a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst +++ b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst @@ -36,12 +36,18 @@ After few seconds, all *Run/Debug Configurations* should be ready to use. **Things you can do with provided configuration**: * run and debug python code + .. image:: images/f1.png + * run and debug tests + .. image:: images/f2.png .. image:: images/f3.png + * run and debug migrations or different django management commands + .. image:: images/f4.png + * and many others.. Known issues From 028728351acebb1935be021d73ba528e7a5f5250 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 28 Dec 2019 08:00:31 -0300 Subject: [PATCH 450/507] Update tox from 3.14.2 to 3.14.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index eccb2d9d..2ab19a9e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ flake8==3.7.9 # Testing # ------------------------------------------------------------------------------ -tox==3.14.2 +tox==3.14.3 pytest==5.3.2 pytest_cases==1.12.0 pytest-cookies==0.4.0 From aa48a03c1ff86c06491a8997a2bbb62757cc0281 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 31 Dec 2019 08:00:30 -0300 Subject: [PATCH 451/507] Update django-compressor from 2.3 to 2.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 c31481a3..7c8c7b2f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -25,7 +25,7 @@ django-model-utils==4.0.0 # https://github.com/jazzband/django-model-utils django-allauth==0.41.0 # https://github.com/pennersr/django-allauth django-crispy-forms==1.8.1 # https://github.com/django-crispy-forms/django-crispy-forms {%- if cookiecutter.use_compressor == "y" %} -django-compressor==2.3 # https://github.com/django-compressor/django-compressor +django-compressor==2.4 # https://github.com/django-compressor/django-compressor {%- endif %} django-redis==4.11.0 # https://github.com/niwinz/django-redis From e33e90fb69a056d3f0f490659a9c826a0df42584 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 2 Jan 2020 08:00:30 -0300 Subject: [PATCH 452/507] Update pillow from 6.2.1 to 7.0.0 --- {{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 c31481a3..2d107178 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,6 +1,6 @@ pytz==2019.3 # https://github.com/stub42/pytz python-slugify==4.0.0 # https://github.com/un33k/python-slugify -Pillow==6.2.1 # https://github.com/python-pillow/Pillow +Pillow==7.0.0 # https://github.com/python-pillow/Pillow {%- if cookiecutter.use_compressor == "y" %} rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin {%- endif %} From 41d514e6cfe4563974b6d1d893fa5de5dbb9e6bf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 3 Jan 2020 08:00:31 -0300 Subject: [PATCH 453/507] Update pre-commit from 1.20.0 to 1.21.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 070a0b2d..8dd68ea4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -24,7 +24,7 @@ pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==1.20.0 # https://github.com/pre-commit/pre-commit +pre-commit==1.21.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From bfe094963582b7b1ccda377709067fb2ca7923c6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 6 Jan 2020 11:00:33 +0000 Subject: [PATCH 454/507] Update coverage from 5.0 to 5.0.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 070a0b2d..0acd5ec1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -18,7 +18,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ flake8==3.7.9 # https://github.com/PyCQA/flake8 -coverage==5.0 # https://github.com/nedbat/coveragepy +coverage==5.0.2 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/ambv/black pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From a0359d9d6a48e1cae6de3a5898e7a9a2258de9b2 Mon Sep 17 00:00:00 2001 From: Hunterx7 Date: Mon, 6 Jan 2020 13:57:19 +0100 Subject: [PATCH 455/507] Bumped runtime for heroku. --- {{cookiecutter.project_slug}}/runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 42731f2f..6919bf9e 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.7.4 +python-3.7.6 From f0e06a2a17746575825c33ee3535a7cfdbbad08b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 7 Jan 2020 11:00:32 +0000 Subject: [PATCH 456/507] Update pyyaml from 5.2 to 5.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index eccb2d9d..8ecf7328 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,4 @@ pytest==5.3.2 pytest_cases==1.12.0 pytest-cookies==0.4.0 pytest-xdist==1.31.0 -pyyaml==5.2 +pyyaml==5.3 From b22045bcd4ebf563ccdcf226fb389a6bb71e2654 Mon Sep 17 00:00:00 2001 From: Trung Dong Huynh Date: Tue, 7 Jan 2020 11:06:31 +0000 Subject: [PATCH 457/507] Replaced base Docker image with debian:buster-slim (#2373) Using system Python 3 distribution (3.7.3) in order to allow the use of Debian packages for numpy, scipy, etc. without the need of building them or installing build dependencies. Changed `#!/bin/sh` in shell scripts to `#!/bin/bash` to make `set -o pipefail` work. --- .../compose/local/django/Dockerfile | 24 +++++++++-------- .../compose/local/django/celery/beat/start | 2 +- .../compose/local/django/celery/flower/start | 2 +- .../compose/local/django/celery/worker/start | 2 +- .../compose/local/django/start | 2 +- .../compose/production/django/Dockerfile | 26 ++++++++++++------- .../production/django/celery/beat/start | 2 +- .../production/django/celery/flower/start | 2 +- .../production/django/celery/worker/start | 2 +- .../compose/production/django/entrypoint | 2 +- .../compose/production/django/start | 2 +- 11 files changed, 38 insertions(+), 30 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index a98547bd..6747322a 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,19 +1,21 @@ -FROM python:3.7-alpine +FROM debian:buster-slim ENV PYTHONUNBUFFERED 1 -RUN apk update \ +RUN apt-get update \ + # dependencies for building Python packages + && apt-get install -y build-essential python3-dev python3-pip \ + # link the system python3 as just python for convenience + && ln -s `which python3` /usr/local/bin/python \ + # update pip et al + && pip3 install -U pip setuptools wheel \ # psycopg2 dependencies - && apk add --virtual build-deps gcc python3-dev musl-dev \ - && apk add postgresql-dev \ - # Pillow dependencies - && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ - # CFFI dependencies - && apk add libffi-dev py-cffi \ + && apt-get install -y libpq-dev \ # Translations dependencies - && apk add gettext \ - # https://docs.djangoproject.com/en/dev/ref/django-admin/#dbshell - && apk add postgresql-client + && apt-get install -y gettext \ + # cleaning up unused files + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* # Requirements are installed here to ensure they will be cached. COPY ./requirements /requirements diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start index 389e2baf..c04a7365 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/beat/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o nounset diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start index be67050d..5bcaa816 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o nounset diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start index 072c6ae6..acd6f157 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/worker/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o nounset diff --git a/{{cookiecutter.project_slug}}/compose/local/django/start b/{{cookiecutter.project_slug}}/compose/local/django/start index 921604dc..f076ee51 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index b0861d60..ddc46f7b 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -9,21 +9,27 @@ RUN npm run build # Python build stage {%- endif %} -FROM python:3.7-alpine +FROM debian:buster-slim ENV PYTHONUNBUFFERED 1 -RUN apk update \ +RUN apt-get update \ + # dependencies for building Python packages + && apt-get install -y build-essential python3-dev python3-pip \ + # link the system python3 as just python for convenience + && ln -s `which python3` /usr/local/bin/python \ + # update pip et al + && pip3 install -U pip setuptools wheel \ # psycopg2 dependencies - && apk add --virtual build-deps gcc python3-dev musl-dev \ - && apk add postgresql-dev \ - # Pillow dependencies - && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ - # CFFI dependencies - && apk add libffi-dev py-cffi + && apt-get install -y libpq-dev \ + # Translations dependencies + && apt-get install -y gettext \ + # cleaning up unused files + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ + && rm -rf /var/lib/apt/lists/* -RUN addgroup -S django \ - && adduser -S -G django django +RUN addgroup --system django \ + && adduser --system --ingroup django django # Requirements are installed here to ensure they will be cached. COPY ./requirements /requirements diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start index 0e793e38..20b93123 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/beat/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start index be67050d..5bcaa816 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o nounset diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start index 4e519c3f..38fb77f3 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/worker/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint index 0a76b310..95ab8297 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/entrypoint +++ b/{{cookiecutter.project_slug}}/compose/production/django/entrypoint @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o pipefail diff --git a/{{cookiecutter.project_slug}}/compose/production/django/start b/{{cookiecutter.project_slug}}/compose/production/django/start index 0ad39dfa..709c1dd0 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/start @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -o errexit set -o pipefail From 4a71b0b9360b2ecea9518b4531a30f25c5735fff Mon Sep 17 00:00:00 2001 From: Trung Dong Huynh Date: Tue, 7 Jan 2020 13:54:15 +0000 Subject: [PATCH 458/507] Using the python:3.7-slim-buster image for later Python version - 3.7.6 (instead of debian:buster-slim, shipped with Python 3.7.3) --- .../compose/local/django/Dockerfile | 8 ++------ .../compose/production/django/Dockerfile | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index 6747322a..94c79952 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -1,14 +1,10 @@ -FROM debian:buster-slim +FROM python:3.7-slim-buster ENV PYTHONUNBUFFERED 1 RUN apt-get update \ # dependencies for building Python packages - && apt-get install -y build-essential python3-dev python3-pip \ - # link the system python3 as just python for convenience - && ln -s `which python3` /usr/local/bin/python \ - # update pip et al - && pip3 install -U pip setuptools wheel \ + && apt-get install -y build-essential \ # psycopg2 dependencies && apt-get install -y libpq-dev \ # Translations dependencies diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index ddc46f7b..9d4dc5fc 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -9,17 +9,13 @@ RUN npm run build # Python build stage {%- endif %} -FROM debian:buster-slim +FROM python:3.7-slim-buster ENV PYTHONUNBUFFERED 1 RUN apt-get update \ # dependencies for building Python packages - && apt-get install -y build-essential python3-dev python3-pip \ - # link the system python3 as just python for convenience - && ln -s `which python3` /usr/local/bin/python \ - # update pip et al - && pip3 install -U pip setuptools wheel \ + && apt-get install -y build-essential \ # psycopg2 dependencies && apt-get install -y libpq-dev \ # Translations dependencies From c94c6acfc453489c952e9bce85c27ef543e5bd6e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 8 Jan 2020 11:00:33 +0000 Subject: [PATCH 459/507] Update sentry-sdk from 0.13.5 to 0.14.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 438ccca6..db3d5e0a 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.13.5 # https://github.com/getsentry/sentry-python +sentry-sdk==0.14.0 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 3814fc7a3f8a513e0bc46ba6a20ad4ce3b1c31ea Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 11 Jan 2020 13:45:37 +0000 Subject: [PATCH 460/507] Update contributors list --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 53edb28e..71ba3d34 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -122,6 +122,7 @@ Listed in alphabetical order. Henrique G. G. Pereira `@ikkebr`_ Ian Lee `@IanLee1521`_ Irfan Ahmad `@erfaan`_ @erfaan + Isaac12x `@Isaac12x`_ Jan Van Bruggen `@jvanbrug`_ Jelmer Draaijer `@foarsitter`_ Jens Nilsson `@phiberjenz`_ @@ -282,6 +283,7 @@ Listed in alphabetical order. .. _@hjwp: https://github.com/hjwp .. _@IanLee1521: https://github.com/IanLee1521 .. _@ikkebr: https://github.com/ikkebr +.. _@Isaac12x: https://github.com/Isaac12x .. _@iynaix: https://github.com/iynaix .. _@jangeador: https://github.com/jangeador .. _@jazztpt: https://github.com/jazztpt From d9d6eb82c64ea0ba04f9017fd096be6442f11f19 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 11 Jan 2020 13:52:47 +0000 Subject: [PATCH 461/507] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7d9220..f526bddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All enhancements and patches to Cookiecutter Django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2020-01-11] +### Changed +- Speed up & reduce size for production Django image +- Bumped runtime version for Heroku +- Added Debian 10 (Buster) OS dependencies + ## [2019-10-06] ### Changed - Default Python version is now 3.7 (@nicolas471) From 5e1bec2744eef38a909645b85fc1442b7172c59e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 11 Jan 2020 14:19:11 +0000 Subject: [PATCH 462/507] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f526bddb..58026739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Speed up & reduce size for production Django image - Bumped runtime version for Heroku - Added Debian 10 (Buster) OS dependencies +- Update Traefik to v2 ## [2019-10-06] ### Changed From 9bd9891541966a38311f7952a30e229c56e773b9 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 11 Jan 2020 16:10:14 +0000 Subject: [PATCH 463/507] Align psycopg2 versions --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- {{cookiecutter.project_slug}}/requirements/production.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index f4c22870..37305f4b 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ Werkzeug==0.16.0 # https://github.com/pallets/werkzeug ipdb==0.12.3 # https://github.com/gotcha/ipdb Sphinx==2.3.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} -psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- else %} psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index db3d5e0a..9e87b18c 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -3,7 +3,7 @@ -r ./base.txt gunicorn==20.0.4 # https://github.com/benoitc/gunicorn -psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +psycopg2==2.8.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} From 30f8000869b75ebe3e0a312b8a105c121541fca1 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 11 Jan 2020 16:47:44 +0000 Subject: [PATCH 464/507] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58026739..10ee2d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Bumped runtime version for Heroku - Added Debian 10 (Buster) OS dependencies - Update Traefik to v2 +- Switched from Alpine based image to Debian based image ## [2019-10-06] ### Changed From 88ff9c1846b84a8feb552ddad8c70fec3b8594c0 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Sat, 11 Jan 2020 16:48:16 +0000 Subject: [PATCH 465/507] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10ee2d03..7a2af7c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Bumped runtime version for Heroku - Added Debian 10 (Buster) OS dependencies - Update Traefik to v2 -- Switched from Alpine based image to Debian based image +- Switched Docker images from Alpine based to Debian based ## [2019-10-06] ### Changed From 08729822451f5149fae49b2fbaab47ebf4c02483 Mon Sep 17 00:00:00 2001 From: Daniel Hillier Date: Mon, 13 Jan 2020 00:28:37 +1100 Subject: [PATCH 466/507] Fix failing mypy tests in users app with django-stubs (#2395) Adds django-stubs as a requirement for local virtualenv. This is required now that the User Model type is being resolved properly. --- .../config/settings/production.py | 2 +- .../config/settings/test.py | 2 +- .../requirements/local.txt | 1 + {{cookiecutter.project_slug}}/setup.cfg | 1 + .../{{cookiecutter.project_slug}}/conftest.py | 4 ++-- .../users/tests/test_models.py | 5 +++-- .../users/tests/test_urls.py | 5 +++-- .../users/tests/test_views.py | 14 ++++---------- 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 22a2acae..39dbc7cd 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -154,7 +154,7 @@ MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" # TEMPLATES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405 +TEMPLATES[0]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405 ( "django.template.loaders.cached.Loader", [ diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index fad41afd..d31b2864 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -32,7 +32,7 @@ PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] # TEMPLATES # ------------------------------------------------------------------------------ -TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405 +TEMPLATES[0]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405 ( "django.template.loaders.cached.Loader", [ diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 37305f4b..c46444ef 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,6 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.761 # https://github.com/python/mypy +django-stubs==1.3.1 # https://github.com/typeddjango/django-stubs pytest==5.3.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index f7cd01cb..5f7d9b65 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -13,6 +13,7 @@ ignore_missing_imports = True warn_unused_ignores = True warn_redundant_casts = True warn_unused_configs = True +plugins = mypy_django_plugin.main [mypy.plugins.django-stubs] django_settings_module = config.settings.test diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py index aae11d26..8cd51d7f 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py @@ -1,7 +1,7 @@ import pytest -from django.conf import settings from django.test import RequestFactory +from {{ cookiecutter.project_slug }}.users.models import User from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory @@ -11,7 +11,7 @@ def media_storage(settings, tmpdir): @pytest.fixture -def user() -> settings.AUTH_USER_MODEL: +def user() -> User: return UserFactory() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py index 54863632..3194be1f 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py @@ -1,8 +1,9 @@ import pytest -from django.conf import settings + +from {{ cookiecutter.project_slug }}.users.models import User pytestmark = pytest.mark.django_db -def test_user_get_absolute_url(user: settings.AUTH_USER_MODEL): +def test_user_get_absolute_url(user: User): assert user.get_absolute_url() == f"/users/{user.username}/" 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 c6361920..933396ba 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py @@ -1,11 +1,12 @@ import pytest -from django.conf import settings from django.urls import reverse, resolve +from {{ cookiecutter.project_slug }}.users.models import User + pytestmark = pytest.mark.django_db -def test_detail(user: settings.AUTH_USER_MODEL): +def test_detail(user: User): assert ( reverse("users:detail", kwargs={"username": user.username}) == f"/users/{user.username}/" diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py index 76cb80aa..9e868899 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py @@ -1,7 +1,7 @@ import pytest -from django.conf import settings from django.test import RequestFactory +from {{ cookiecutter.project_slug }}.users.models import User from {{ cookiecutter.project_slug }}.users.views import UserRedirectView, UserUpdateView pytestmark = pytest.mark.django_db @@ -16,9 +16,7 @@ class TestUserUpdateView: https://github.com/pytest-dev/pytest-django/pull/258 """ - def test_get_success_url( - self, user: settings.AUTH_USER_MODEL, request_factory: RequestFactory - ): + def test_get_success_url(self, user: User, request_factory: RequestFactory): view = UserUpdateView() request = request_factory.get("/fake-url/") request.user = user @@ -27,9 +25,7 @@ class TestUserUpdateView: assert view.get_success_url() == f"/users/{user.username}/" - def test_get_object( - self, user: settings.AUTH_USER_MODEL, request_factory: RequestFactory - ): + def test_get_object(self, user: User, request_factory: RequestFactory): view = UserUpdateView() request = request_factory.get("/fake-url/") request.user = user @@ -40,9 +36,7 @@ class TestUserUpdateView: class TestUserRedirectView: - def test_get_redirect_url( - self, user: settings.AUTH_USER_MODEL, request_factory: RequestFactory - ): + def test_get_redirect_url(self, user: User, request_factory: RequestFactory): view = UserRedirectView() request = request_factory.get("/fake-url") request.user = user From 9d1d5e47ff18682a1190fa4ef2b916044daf34ab Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 13 Jan 2020 11:00:33 +0000 Subject: [PATCH 467/507] Update coverage from 5.0.2 to 5.0.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 37305f4b..01394c15 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -18,7 +18,7 @@ pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality # ------------------------------------------------------------------------------ flake8==3.7.9 # https://github.com/PyCQA/flake8 -coverage==5.0.2 # https://github.com/nedbat/coveragepy +coverage==5.0.3 # https://github.com/nedbat/coveragepy black==19.10b0 # https://github.com/ambv/black pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} From 60bf49a10cc840d551d15c99ab9ec962f1d34ebf Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 13 Jan 2020 12:40:32 +0000 Subject: [PATCH 468/507] Update CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 87c8b4bd..3e1f1cfe 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -94,6 +94,7 @@ Listed in alphabetical order. Dan Shultz `@shultz`_ Dani Hodovic `@danihodovic`_ Daniel Hepper `@dhepper`_ @danielhepper + Daniel Hillier `@danifus`_ Daniele Tricoli `@eriol`_ David Díaz `@ddiazpinto`_ @DavidDiazPinto Davit Tovmasyan `@davitovmasyan`_ @@ -255,6 +256,7 @@ Listed in alphabetical order. .. _@curtisstpierre: https://github.com/curtisstpierre .. _@dadokkio: https://github.com/dadokkio .. _@danihodovic: https://github.com/danihodovic +.. _@danifus: https://github.com/danifus .. _@davitovmasyan: https://github.com/davitovmasyan .. _@ddiazpinto: https://github.com/ddiazpinto .. _@delneg: https://github.com/delneg From 463c1f83e6896284b6c77b868b42797425a99c38 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 13 Jan 2020 17:51:50 +0000 Subject: [PATCH 469/507] Update CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 3e1f1cfe..14394dde 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -125,6 +125,7 @@ Listed in alphabetical order. Ian Lee `@IanLee1521`_ Irfan Ahmad `@erfaan`_ @erfaan Isaac12x `@Isaac12x`_ + Ivan Khomutov `@ikhomutov`_ Jan Van Bruggen `@jvanbrug`_ Jelmer Draaijer `@foarsitter`_ Jens Nilsson `@phiberjenz`_ @@ -286,6 +287,7 @@ Listed in alphabetical order. .. _@hendrikschneider: https://github.com/hendrikschneider .. _@hjwp: https://github.com/hjwp .. _@IanLee1521: https://github.com/IanLee1521 +.. _@ikhomutov: https://github.com/ikhomutov .. _@ikkebr: https://github.com/ikkebr .. _@Isaac12x: https://github.com/Isaac12x .. _@iynaix: https://github.com/iynaix From d9d80751dd44d40c9b7da5a56b71e1e92d350c7d Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 13 Jan 2020 22:42:35 +0000 Subject: [PATCH 470/507] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a2af7c0..b12ce03e 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/). +## [2020-01-12] +### Changed +- Fix mypy setup and added django-stubs +- Add Gitlab CI as option + ## [2020-01-11] ### Changed - Speed up & reduce size for production Django image From 6d4128b487f83e1083b9249d5709558c24feec2b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 14 Jan 2020 11:00:32 +0000 Subject: [PATCH 471/507] Update django-stubs from 1.3.1 to 1.4.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 600ef4f5..ebaad16e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -12,7 +12,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # Testing # ------------------------------------------------------------------------------ mypy==0.761 # https://github.com/python/mypy -django-stubs==1.3.1 # https://github.com/typeddjango/django-stubs +django-stubs==1.4.0 # https://github.com/typeddjango/django-stubs pytest==5.3.1 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar From 82c483bad52871498bf9f2d5d65f956124df3589 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 14 Jan 2020 11:00:37 +0000 Subject: [PATCH 472/507] Update pytest-django from 3.7.0 to 3.8.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 600ef4f5..95c57d7c 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -34,4 +34,4 @@ factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==2.1 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin -pytest-django==3.7.0 # https://github.com/pytest-dev/pytest-django +pytest-django==3.8.0 # https://github.com/pytest-dev/pytest-django From 43601d805ab3a10ccb42496e26f0ea851e57794e Mon Sep 17 00:00:00 2001 From: Bo Date: Tue, 14 Jan 2020 08:49:33 -0600 Subject: [PATCH 473/507] Update CONTRIBUTORS.rst --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 14394dde..e4ef3181 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -71,6 +71,7 @@ Listed in alphabetical order. Benjamin Abel Bert de Miranda `@bertdemiranda`_ Bo Lopker `@blopker`_ + Bo Peng `@BoPeng`_ Bouke Haarsma Brent Payne `@brentpayne`_ @brentpayne Bruce Olivier `@bolivierjr`_ @@ -235,6 +236,7 @@ Listed in alphabetical order. .. _@blopker: https://github.com/blopker .. _@bogdal: https://github.com/bogdal .. _@bolivierjr: https://github.com/bolivierjr +.. _@BoPeng: https://github.com/BoPeng .. _@brentpayne: https://github.com/brentpayne .. _@btknu: https://github.com/btknu .. _@burhan: https://github.com/burhan From 15fc92ace134386adfced5b94504117eec8e954b Mon Sep 17 00:00:00 2001 From: Bo Date: Tue, 14 Jan 2020 08:50:38 -0600 Subject: [PATCH 474/507] Assuming DTL to be the last instead of first template engine --- {{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 39dbc7cd..36667b33 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -154,7 +154,7 @@ MEDIA_URL = f"https://storage.googleapis.com/{GS_BUCKET_NAME}/media/" # TEMPLATES # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#templates -TEMPLATES[0]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405 +TEMPLATES[-1]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405 ( "django.template.loaders.cached.Loader", [ From 1609d4410edc51a43a2487e55b6c013d1ce1c3ac Mon Sep 17 00:00:00 2001 From: Bo Date: Tue, 14 Jan 2020 21:19:44 -0600 Subject: [PATCH 475/507] Fix loaders option in test environment as well --- {{cookiecutter.project_slug}}/config/settings/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py index d31b2864..667bb20d 100644 --- a/{{cookiecutter.project_slug}}/config/settings/test.py +++ b/{{cookiecutter.project_slug}}/config/settings/test.py @@ -32,7 +32,7 @@ PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] # TEMPLATES # ------------------------------------------------------------------------------ -TEMPLATES[0]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405 +TEMPLATES[-1]["OPTIONS"]["loaders"] = [ # type: ignore[index] # noqa F405 ( "django.template.loaders.cached.Loader", [ From 2f9d69398063025a59e7b2159f345af4bbaeb4ea Mon Sep 17 00:00:00 2001 From: howiezhao Date: Thu, 16 Jan 2020 11:31:37 +0800 Subject: [PATCH 476/507] style: formatting code --- {{cookiecutter.project_slug}}/docs/conf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/docs/conf.py b/{{cookiecutter.project_slug}}/docs/conf.py index 3c5d84ad..bfde1e3a 100644 --- a/{{cookiecutter.project_slug}}/docs/conf.py +++ b/{{cookiecutter.project_slug}}/docs/conf.py @@ -12,6 +12,7 @@ # import os import sys + # import django # sys.path.insert(0, os.path.abspath('..')) # os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") @@ -30,16 +31,15 @@ author = "{{ cookiecutter.author_name }}" # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ -] +extensions = [] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- @@ -47,9 +47,9 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = "alabaster" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] From d1a46b5d4ded1342459aba839963a92ceaccccd3 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 Jan 2020 10:53:54 +0000 Subject: [PATCH 477/507] Update badge from Gitter to Slack --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 2fba0979..337a8845 100644 --- a/README.rst +++ b/README.rst @@ -9,8 +9,8 @@ Cookiecutter Django :target: https://pyup.io/repos/github/pydanny/cookiecutter-django/ :alt: Updates -.. image:: https://badges.gitter.im/Join Chat.svg - :target: https://gitter.im/pydanny/cookiecutter-django?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +.. image:: https://img.shields.io/badge/cookiecutter-Join%20on%20Slack-green?style=flat&logo=slack + :target: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge .. image:: https://www.codetriage.com/pydanny/cookiecutter-django/badges/users.svg :target: https://www.codetriage.com/pydanny/cookiecutter-django From cb95128b178b7948cc4a6c72784952d86c756b36 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 17 Jan 2020 10:56:11 +0000 Subject: [PATCH 478/507] Change link from Gitter to Slack --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 337a8845..6e534b0f 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ Cookiecutter Django :alt: Updates .. image:: https://img.shields.io/badge/cookiecutter-Join%20on%20Slack-green?style=flat&logo=slack - :target: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + :target: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U .. image:: https://www.codetriage.com/pydanny/cookiecutter-django/badges/users.svg :target: https://www.codetriage.com/pydanny/cookiecutter-django @@ -226,11 +226,11 @@ Community * Have questions? **Before you ask questions anywhere else**, please post your question on `Stack Overflow`_ under the *cookiecutter-django* tag. We check there periodically for questions. * If you think you found a bug or want to request a feature, please open an issue_. -* For anything else, you can chat with us on `Gitter`_. +* For anything else, you can chat with us on `Slack`_. .. _`Stack Overflow`: http://stackoverflow.com/questions/tagged/cookiecutter-django .. _`issue`: https://github.com/pydanny/cookiecutter-django/issues -.. _`Gitter`: https://gitter.im/pydanny/cookiecutter-django?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +.. _`Slack`: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U For Readers of Two Scoops of Django -------------------------------------------- From c02587300ea6f879b220637d6d5406a78fcd26b3 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 17 Jan 2020 11:00:36 +0000 Subject: [PATCH 479/507] Update django-extensions from 2.2.5 to 2.2.6 --- {{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 d0f8ef22..544930ad 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -32,6 +32,6 @@ pre-commit==1.21.0 # https://github.com/pre-commit/pre-commit factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==2.1 # https://github.com/jazzband/django-debug-toolbar -django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions +django-extensions==2.2.6 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.8.0 # https://github.com/pytest-dev/pytest-django From 70f43c77160bc786f5a965ee8e3ea67e28175022 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 17 Jan 2020 11:00:40 +0000 Subject: [PATCH 480/507] Update django-coverage-plugin from 1.6.0 to 1.7.0 --- {{cookiecutter.project_slug}}/requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index d0f8ef22..4abefa7e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -33,5 +33,5 @@ factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==2.1 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.5 # https://github.com/django-extensions/django-extensions -django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin +django-coverage-plugin==1.7.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.8.0 # https://github.com/pytest-dev/pytest-django From 546168c64ba47219e8d3cddc4322bb97c6c9efc6 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 18 Jan 2020 11:00:33 +0000 Subject: [PATCH 481/507] Update pytest from 5.3.2 to 5.3.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2f7772b2..b4be7b5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.9 # Testing # ------------------------------------------------------------------------------ tox==3.14.3 -pytest==5.3.2 +pytest==5.3.3 pytest_cases==1.12.0 pytest-cookies==0.4.0 pytest-xdist==1.31.0 From a69bf2e778ff4d0bc12857c45e5187e1074a829d Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 18 Jan 2020 11:00:34 +0000 Subject: [PATCH 482/507] Update pytest from 5.3.1 to 5.3.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 544930ad..345193b5 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # ------------------------------------------------------------------------------ mypy==0.761 # https://github.com/python/mypy django-stubs==1.4.0 # https://github.com/typeddjango/django-stubs -pytest==5.3.1 # https://github.com/pytest-dev/pytest +pytest==5.3.3 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From 3f6562c7fe79b961952014285c887d958e102906 Mon Sep 17 00:00:00 2001 From: Bo Peng <47236991+bioworkflows@users.noreply.github.com> Date: Sun, 19 Jan 2020 16:21:27 -0600 Subject: [PATCH 483/507] Honor passed password for UserFactory --- .../{{cookiecutter.project_slug}}/users/tests/factories.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py index b5371366..290f7b41 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py @@ -12,7 +12,7 @@ class UserFactory(DjangoModelFactory): @post_generation def password(self, create: bool, extracted: Sequence[Any], **kwargs): - password = Faker( + password = extracted if extracted else Faker( "password", length=42, special_chars=True, From a0fff1d0859699a430d69ad05c158477e6ea8710 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 21 Jan 2020 11:00:33 +0000 Subject: [PATCH 484/507] Update pytest from 5.3.3 to 5.3.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b4be7b5d..8d9b1685 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.9 # Testing # ------------------------------------------------------------------------------ tox==3.14.3 -pytest==5.3.3 +pytest==5.3.4 pytest_cases==1.12.0 pytest-cookies==0.4.0 pytest-xdist==1.31.0 From 8ceaa3e1c72e13ea5b29c7581fa09b61bf45a12b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Tue, 21 Jan 2020 11:00:34 +0000 Subject: [PATCH 485/507] Update pytest from 5.3.3 to 5.3.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 6fd88bc7..4acb1d9d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # ------------------------------------------------------------------------------ mypy==0.761 # https://github.com/python/mypy django-stubs==1.4.0 # https://github.com/typeddjango/django-stubs -pytest==5.3.3 # https://github.com/pytest-dev/pytest +pytest==5.3.4 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From bc00a343ea6c93cc078e8f55f033fef1d9af1a88 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Wed, 22 Jan 2020 10:52:31 +0000 Subject: [PATCH 486/507] Fix broken links in doc fixes #2408 --- docs/testing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/testing.rst b/docs/testing.rst index 63cb9e18..9aaa2455 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -49,8 +49,8 @@ Once the tests are complete, in order to see the code coverage, run the followin Since this is a fresh install, and there are no tests built using the Python `unittest`_ library yet, you should get feedback that says there were no tests carried out. .. _Pytest: https://docs.pytest.org/en/latest/example/simple.html -.. _develop locally: ../developing-locally.rst -.. _develop locally with docker: ..../developing-locally-docker.rst +.. _develop locally: ./developing-locally.html +.. _develop locally with docker: ./developing-locally-docker.html .. _customize: https://docs.pytest.org/en/latest/customize.html .. _unittest: https://docs.python.org/3/library/unittest.html#module-unittest -.. _configuring: https://coverage.readthedocs.io/en/v4.5.x/config.html \ No newline at end of file +.. _configuring: https://coverage.readthedocs.io/en/v4.5.x/config.html From 9bf6ee16b215648c4014f4ef6fbe351fb0f0d5bc Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 22 Jan 2020 11:00:32 +0000 Subject: [PATCH 487/507] Update sentry-sdk from 0.14.0 to 0.14.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 9e87b18c..38420a38 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg2==2.8.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 Collectfast==1.3.1 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==0.14.0 # https://github.com/getsentry/sentry-python +sentry-sdk==0.14.1 # https://github.com/getsentry/sentry-python {%- endif %} # Django From 2833600aec432f9af9f4437e38a7fb2674f17335 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 23 Jan 2020 14:43:17 +0000 Subject: [PATCH 488/507] Test generation with and without DRF --- tests/test_cookiecutter_generation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index 8c2f71fe..cd23b312 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -33,6 +33,7 @@ def context(): @pytest.mark.parametrize("use_mailhog", ["y", "n"], ids=lambda yn: f"mailhog:{yn}") @pytest.mark.parametrize("use_sentry", ["y", "n"], ids=lambda yn: f"sentry:{yn}") @pytest.mark.parametrize("use_compressor", ["y", "n"], ids=lambda yn: f"cmpr:{yn}") +@pytest.mark.parametrize("use_drf", ["y", "n"], ids=lambda yn: f"drf:{yn}") @pytest.mark.parametrize( "use_whitenoise,cloud_provider", [ @@ -53,6 +54,7 @@ def context_combination( use_sentry, use_compressor, use_whitenoise, + use_drf, cloud_provider, ): """Fixture that parametrize the function where it's used.""" @@ -64,6 +66,7 @@ def context_combination( "use_mailhog": use_mailhog, "use_sentry": use_sentry, "use_whitenoise": use_whitenoise, + "use_drf": use_drf, "cloud_provider": cloud_provider, } From fd43059e289e15296015b7a2eff9db9b8b1ff5e1 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 23 Jan 2020 17:52:17 +0000 Subject: [PATCH 489/507] Update formatting --- .../users/tests/factories.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py index 290f7b41..8917c5ae 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/factories.py @@ -12,14 +12,18 @@ class UserFactory(DjangoModelFactory): @post_generation def password(self, create: bool, extracted: Sequence[Any], **kwargs): - password = extracted if extracted else Faker( - "password", - length=42, - special_chars=True, - digits=True, - upper_case=True, - lower_case=True, - ).generate(extra_kwargs={}) + password = ( + extracted + if extracted + else Faker( + "password", + length=42, + special_chars=True, + digits=True, + upper_case=True, + lower_case=True, + ).generate(extra_kwargs={}) + ) self.set_password(password) class Meta: From fa9a8cfe7ba3d40540d30f8f5b834541191b3f0d Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 23 Jan 2020 15:04:30 +0000 Subject: [PATCH 490/507] Fix code formatting --- {{cookiecutter.project_slug}}/config/api_router.py | 4 ++-- {{cookiecutter.project_slug}}/config/settings/base.py | 10 ++++------ {{cookiecutter.project_slug}}/config/urls.py | 5 +++-- .../users/api/serializers.py | 6 +++--- .../{{cookiecutter.project_slug}}/users/api/views.py | 8 ++++---- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/api_router.py b/{{cookiecutter.project_slug}}/config/api_router.py index fc8107b4..46a797a7 100644 --- a/{{cookiecutter.project_slug}}/config/api_router.py +++ b/{{cookiecutter.project_slug}}/config/api_router.py @@ -7,8 +7,8 @@ if settings.DEBUG: else: router = SimpleRouter() -router.register('users', UserViewSet) +router.register("users", UserViewSet) -app_name = 'api' +app_name = "api" urlpatterns = router.urls diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 06a3fc89..ca43eb88 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -308,13 +308,11 @@ STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"] # ------------------------------------------------------------------------------- # django-rest-framework - https://www.django-rest-framework.org/api-guide/settings/ REST_FRAMEWORK = { - 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework.authentication.SessionAuthentication', - 'rest_framework.authentication.TokenAuthentication', + "DEFAULT_AUTHENTICATION_CLASSES": ( + "rest_framework.authentication.SessionAuthentication", + "rest_framework.authentication.TokenAuthentication", ), - 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.IsAuthenticated', - ) + "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",), } {%- endif %} # Your stuff... diff --git a/{{cookiecutter.project_slug}}/config/urls.py b/{{cookiecutter.project_slug}}/config/urls.py index 5382bdb7..382bf895 100644 --- a/{{cookiecutter.project_slug}}/config/urls.py +++ b/{{cookiecutter.project_slug}}/config/urls.py @@ -24,9 +24,10 @@ urlpatterns = [ # API URLS urlpatterns += [ # API base url - path("api/", include('config.api_router')), + path("api/", include("config.api_router")), # DRF auth token - path("auth-token/", obtain_auth_token)] + path("auth-token/", obtain_auth_token), +] {%- endif %} if settings.DEBUG: diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py index 8fc2262e..bb52738b 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/serializers.py @@ -1,12 +1,12 @@ from rest_framework import serializers from {{ cookiecutter.project_slug }}.users.models import User + class UserSerializer(serializers.ModelSerializer): class Meta: model = User - fields = ['username', 'email', 'name', 'url'] + fields = ["username", "email", "name", "url"] extra_kwargs = { - 'url': {'view_name': 'api:user-detail', 'lookup_field': 'username'} + "url": {"view_name": "api:user-detail", "lookup_field": "username"} } - diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py index 440cc9b2..7b5af999 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/api/views.py @@ -5,20 +5,20 @@ from rest_framework.mixins import RetrieveModelMixin, ListModelMixin, UpdateMode from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet - from .serializers import UserSerializer + User = get_user_model() class UserViewSet(RetrieveModelMixin, ListModelMixin, UpdateModelMixin, GenericViewSet): serializer_class = UserSerializer queryset = User.objects.all() - lookup_field = 'username' + lookup_field = "username" def get_queryset(self, *args, **kwargs): return self.queryset.filter(id=self.request.user.id) - @action(detail=False, methods=['GET']) + @action(detail=False, methods=["GET"]) def me(self, request): - serializer = UserSerializer(request.user, context={'request': request}) + serializer = UserSerializer(request.user, context={"request": request}) return Response(status=status.HTTP_200_OK, data=serializer.data) From 4bf0533bfabf5f34cdeff08f8bac75f090fa0def Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 23 Jan 2020 18:39:38 +0000 Subject: [PATCH 491/507] Fix broken links duplicated from testing.rst --- docs/document.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/document.rst b/docs/document.rst index abf115a1..7207e357 100644 --- a/docs/document.rst +++ b/docs/document.rst @@ -41,5 +41,5 @@ Sphinx can automatically generate documentation from docstrings, to enable this 4. Regenerate HTML documentation as written above. .. _Sphinx: https://www.sphinx-doc.org/en/master/index.html -.. _develop locally: ../developing-locally.rst -.. _develop locally with docker: ..../developing-locally-docker.rst +.. _develop locally: ./developing-locally.html +.. _develop locally with docker: ./developing-locally-docker.html From e8fcf9ed6053bd467284fff40c9effeabd33a7a6 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Thu, 23 Jan 2020 18:53:03 +0000 Subject: [PATCH 492/507] Update list of contributors and changelog --- CHANGELOG.md | 20 ++++++++++++-------- CONTRIBUTORS.rst | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b12ce03e..ae8f7efe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,23 @@ # Change Log All enhancements and patches to Cookiecutter Django will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). + +## [2020-01-23] +### Changed +- Fix UserFactory to set the password if provided (@BoPeng) +- Update documentation files with latest Sphinx (@howiezhao) ## [2020-01-12] ### Changed -- Fix mypy setup and added django-stubs -- Add Gitlab CI as option +- Fix mypy setup and added django-stubs (@danifus) +- Add Gitlab CI as option (@ikhomutov) ## [2020-01-11] ### Changed -- Speed up & reduce size for production Django image -- Bumped runtime version for Heroku -- Added Debian 10 (Buster) OS dependencies -- Update Traefik to v2 -- Switched Docker images from Alpine based to Debian based +- Speed up & reduce size for production Django image (@maxp) +- Bumped runtime version for Heroku (@Isaac12x) +- Added Debian 10 (Buster) OS dependencies (@ddiazpinto) +- Update Traefik to v2 (@blaxpy) +- Switched Docker images from Alpine based to Debian based (@trungdong) ## [2019-10-06] ### Changed diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index e4ef3181..77ede253 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -123,6 +123,7 @@ Listed in alphabetical order. Harry Percival `@hjwp`_ Hendrik Schneider `@hendrikschneider`_ Henrique G. G. Pereira `@ikkebr`_ + Howie Zhao `@howiezhao`_ Ian Lee `@IanLee1521`_ Irfan Ahmad `@erfaan`_ @erfaan Isaac12x `@Isaac12x`_ @@ -288,6 +289,7 @@ Listed in alphabetical order. .. _@hanaquadara: https://github.com/hanaquadara .. _@hendrikschneider: https://github.com/hendrikschneider .. _@hjwp: https://github.com/hjwp +.. _@howiezhao: https://github.com/howiezhao .. _@IanLee1521: https://github.com/IanLee1521 .. _@ikhomutov: https://github.com/ikhomutov .. _@ikkebr: https://github.com/ikkebr From 2b34e270139f970bd4cc16ae3b1cd8c5a64f65f4 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 24 Jan 2020 11:00:30 +0000 Subject: [PATCH 493/507] Update django-coverage-plugin from 1.7.0 to 1.8.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 4acb1d9d..51ab40c4 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -33,5 +33,5 @@ factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy django-debug-toolbar==2.1 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.6 # https://github.com/django-extensions/django-extensions -django-coverage-plugin==1.7.0 # https://github.com/nedbat/django_coverage_plugin +django-coverage-plugin==1.8.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.8.0 # https://github.com/pytest-dev/pytest-django From 884e80fc5254398bf295ffce913066f81a756bfd Mon Sep 17 00:00:00 2001 From: Michael Samoylov Date: Fri, 24 Jan 2020 13:59:36 +0200 Subject: [PATCH 494/507] Fixed the redis-py project URL Previously it was pointing to the Redis project repository. --- {{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 9ea6b912..21753640 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==5.0.1 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.11 # https://github.com/antirez/redis +redis==3.3.11 # https://github.com/andymccurdy/redis-py {%- if cookiecutter.use_celery == "y" %} celery==4.4.0 # pyup: < 5.0 # https://github.com/celery/celery django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat From f109e65816265c4812077a17fadfb19ecec0da2e Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 24 Jan 2020 15:28:03 +0000 Subject: [PATCH 495/507] Update list of contributors --- CONTRIBUTORS.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 77ede253..44e32cdd 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -167,6 +167,7 @@ Listed in alphabetical order. Meghan Heintz `@dot2dotseurat`_ Mesut Yılmaz `@myilmaz`_ Michael Gecht `@mimischi`_ @_mischi + Michael Samoylov `@msamoylov`_ Min ho Kim `@minho42`_ mozillazg `@mozillazg`_ Nico Stefani `@nicolas471`_ @moby_dick91 @@ -325,6 +326,7 @@ Listed in alphabetical order. .. _@mozillazg: https://github.com/mozillazg .. _@mrcoles: https://github.com/mrcoles .. _@msaizar: https://github.com/msaizar +.. _@msamoylov: https://github.com/msamoylov .. _@myilmaz: https://github.com/myilmaz .. _@nicolas471: https://github.com/nicolas471 .. _@noisy: https://github.com/noisy From 9734582a88a9566910b60ffa66756a8fd50212ed Mon Sep 17 00:00:00 2001 From: browniebroke Date: Mon, 27 Jan 2020 11:00:31 +0000 Subject: [PATCH 496/507] Update werkzeug from 0.16.0 to 0.16.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 51ab40c4..426fae38 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,6 +1,6 @@ -r ./base.txt -Werkzeug==0.16.0 # https://github.com/pallets/werkzeug +Werkzeug==0.16.1 # https://github.com/pallets/werkzeug ipdb==0.12.3 # https://github.com/gotcha/ipdb Sphinx==2.3.1 # https://github.com/sphinx-doc/sphinx {%- if cookiecutter.use_docker == 'y' %} From 54a38bfb4312e2f03e487051daf19d54015b03a0 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Tue, 28 Jan 2020 10:55:09 +0100 Subject: [PATCH 497/507] Allow rendering custom widgets from root templates dir (#2356) * Allow rendering custom widgets from root templates dir Rendering custom widgets from the projects root template directory doesn't work out of the box. See: https://stackoverflow.com/questions/45844032/django-templatedoesnotexist-in-case-of-a-custom-widget/46208414#46-208414 This changes the setting to use the same template finding logic that the TEMPLATES setting uses. * update APP_DIRS=True * fixup! update APP_DIRS=True --- {{cookiecutter.project_slug}}/config/settings/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index ecfeed7a..42edac1f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -68,6 +68,7 @@ DJANGO_APPS = [ "django.contrib.staticfiles", # "django.contrib.humanize", # Handy template tags "django.contrib.admin", + "django.forms", ] THIRD_PARTY_APPS = [ "crispy_forms", @@ -196,6 +197,10 @@ TEMPLATES = [ }, } ] + +# https://docs.djangoproject.com/en/dev/ref/settings/#form-renderer +FORM_RENDERER = "django.forms.renderers.TemplatesSetting" + # http://django-crispy-forms.readthedocs.io/en/latest/install.html#template-packs CRISPY_TEMPLATE_PACK = "bootstrap4" From 2698867cf8b949b03ed215883f51538fe2f04b38 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 28 Jan 2020 10:33:24 +0000 Subject: [PATCH 498/507] Typo --- 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 cd23b312..40e6cf1b 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -42,7 +42,7 @@ def context(): ("y", "None"), ("n", "AWS"), ("n", "GCP"), - # no whitenoise + co cloud provider is not supported + # no whitenoise + no cloud provider is not supported ], ids=lambda id: f"wnoise:{id[0]}-cloud:{id[1]}", ) From f9564485f5b9a2817a54c14be91174860a075236 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 29 Jan 2020 11:00:31 +0000 Subject: [PATCH 499/507] Update pytest_cases from 1.12.0 to 1.12.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8d9b1685..ae3a3c05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ flake8==3.7.9 # ------------------------------------------------------------------------------ tox==3.14.3 pytest==5.3.4 -pytest_cases==1.12.0 +pytest_cases==1.12.1 pytest-cookies==0.4.0 pytest-xdist==1.31.0 pyyaml==5.3 From abdbe387a0d5c7e757840dde84cd095addfed6d0 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Wed, 29 Jan 2020 11:00:34 +0000 Subject: [PATCH 500/507] Update pre-commit from 1.21.0 to 2.0.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 426fae38..80500e5e 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -25,7 +25,7 @@ pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==1.21.0 # https://github.com/pre-commit/pre-commit +pre-commit==2.0.0 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From a0e2e7aa0566e1dd867e11d095d7849ae8780dac Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 30 Jan 2020 11:00:30 +0000 Subject: [PATCH 501/507] Update pytest from 5.3.4 to 5.3.5 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ae3a3c05..afc125ad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ flake8==3.7.9 # Testing # ------------------------------------------------------------------------------ tox==3.14.3 -pytest==5.3.4 +pytest==5.3.5 pytest_cases==1.12.1 pytest-cookies==0.4.0 pytest-xdist==1.31.0 From 1305ddaa6af7eb3fc312f048565ce18f36afc7bf Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 30 Jan 2020 11:00:31 +0000 Subject: [PATCH 502/507] Update pytest from 5.3.4 to 5.3.5 --- {{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 80500e5e..f4844ed8 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ psycopg2-binary==2.8.4 # https://github.com/psycopg/psycopg2 # ------------------------------------------------------------------------------ mypy==0.761 # https://github.com/python/mypy django-stubs==1.4.0 # https://github.com/typeddjango/django-stubs -pytest==5.3.4 # https://github.com/pytest-dev/pytest +pytest==5.3.5 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar # Code quality From d292590ceba9127250b52cdc3b711b7912bff63b Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 30 Jan 2020 11:00:35 +0000 Subject: [PATCH 503/507] Update pre-commit from 2.0.0 to 2.0.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 80500e5e..df3e2780 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -25,7 +25,7 @@ pylint-django==2.0.13 # https://github.com/PyCQA/pylint-django {%- if cookiecutter.use_celery == 'y' %} pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery {%- endif %} -pre-commit==2.0.0 # https://github.com/pre-commit/pre-commit +pre-commit==2.0.1 # https://github.com/pre-commit/pre-commit # Django # ------------------------------------------------------------------------------ From dec1abb3d0799f6a6dc88194ea910c3bd7b1be8e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Fri, 31 Jan 2020 11:00:30 +0000 Subject: [PATCH 504/507] Update redis from 3.3.11 to 3.4.0 --- {{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 21753640..fb32701f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==5.0.1 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.3.11 # https://github.com/andymccurdy/redis-py +redis==3.4.0 # https://github.com/andymccurdy/redis-py {%- if cookiecutter.use_celery == "y" %} celery==4.4.0 # pyup: < 5.0 # https://github.com/celery/celery django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat From 1f35086fe50df7e341985784b3493e382a1f7fda Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 31 Jan 2020 17:15:37 +0000 Subject: [PATCH 505/507] Downgrade Redis to 3.3.11 as Kombu is incompatible with 3.4.0 Fixes #2425 --- {{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 fb32701f..b4926de5 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==5.0.1 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.4.0 # https://github.com/andymccurdy/redis-py +redis==3.3.11 # pyup: != 3.4.0 # https://github.com/andymccurdy/redis-py {%- if cookiecutter.use_celery == "y" %} celery==4.4.0 # pyup: < 5.0 # https://github.com/celery/celery django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat From af7dcd7ab275baaa8a5741b925fc8b729320e044 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 1 Feb 2020 11:00:29 +0000 Subject: [PATCH 506/507] Update django-celery-beat from 1.5.0 to 1.6.0 --- {{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 b4926de5..dabc10c9 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,7 +11,7 @@ whitenoise==5.0.1 # https://github.com/evansd/whitenoise redis==3.3.11 # pyup: != 3.4.0 # https://github.com/andymccurdy/redis-py {%- if cookiecutter.use_celery == "y" %} celery==4.4.0 # pyup: < 5.0 # https://github.com/celery/celery -django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat +django-celery-beat==1.6.0 # https://github.com/celery/django-celery-beat {%- if cookiecutter.use_docker == 'y' %} flower==0.9.3 # https://github.com/mher/flower {%- endif %} From 3c177776d8209721b7a9d98833f7256f7c288459 Mon Sep 17 00:00:00 2001 From: browniebroke Date: Sat, 1 Feb 2020 11:00:33 +0000 Subject: [PATCH 507/507] Update django-debug-toolbar from 2.1 to 2.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 611ea119..f7782f0d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -31,7 +31,7 @@ pre-commit==2.0.1 # https://github.com/pre-commit/pre-commit # ------------------------------------------------------------------------------ factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy -django-debug-toolbar==2.1 # https://github.com/jazzband/django-debug-toolbar +django-debug-toolbar==2.2 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.6 # https://github.com/django-extensions/django-extensions django-coverage-plugin==1.8.0 # https://github.com/nedbat/django_coverage_plugin pytest-django==3.8.0 # https://github.com/pytest-dev/pytest-django