From 5b75ad6c9d4237397961b55308a9ce8a8463ce3b Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Mon, 24 Apr 2017 15:26:08 +0300 Subject: [PATCH 01/73] Require celery==3.1.24 instead of celery==4.0.2 (#1140) --- {{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 4ab0d9b45..7fe56d76d 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -51,7 +51,7 @@ django-redis==4.7.0 redis>=2.10.5 {% if cookiecutter.use_celery == "y" %} -celery==4.0.2 +celery==3.1.24 {% endif %} {% if cookiecutter.use_compressor == "y" %} From 1d87fa5ed9b4d0f65669d83280be4560f6e6eda4 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Mon, 24 Apr 2017 08:11:10 -0700 Subject: [PATCH 02/73] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 68d6088dc..80141a2ef 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ Features --------- * For Django 1.10 -* Works with Python 3.4.x or 3.5.x. Python 3.6 is experimenta +* Works with Python 3.4.x or 3.5.x. Python 3.6 is experimental * Renders Django projects with 100% starting test coverage * Twitter Bootstrap_ v4.0.0 - alpha 6 (`maintained Foundation fork`_ also available) * 12-Factor_ based settings via django-environ_ From 65e64fe364372cbcdc501c20c81fc1d7941428d6 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Mon, 24 Apr 2017 19:35:58 +0300 Subject: [PATCH 03/73] Fix CELERY_BROKER_URL naming mismatch (#1143) * Fix CELERY_BROKER_URL naming mismatch Closes #1116 * Fix all occurences --- {{cookiecutter.project_slug}}/config/settings/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 14a6f0a39..274e28067 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -267,11 +267,11 @@ AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify' {% if cookiecutter.use_celery == 'y' %} ########## CELERY INSTALLED_APPS += ['{{cookiecutter.project_slug}}.taskapp.celery.CeleryConfig'] -BROKER_URL = env('CELERY_BROKER_URL', default='django://') -if BROKER_URL == 'django://': +CELERY_BROKER_URL = env('CELERY_BROKER_URL', default='django://') +if CELERY_BROKER_URL == 'django://': CELERY_RESULT_BACKEND = 'redis://' else: - CELERY_RESULT_BACKEND = BROKER_URL + CELERY_RESULT_BACKEND = CELERY_BROKER_URL ########## END CELERY {% endif %} From 9ea4ace6fbf333cf7402106beb234afad1694836 Mon Sep 17 00:00:00 2001 From: jduraj Date: Mon, 24 Apr 2017 18:09:21 +0100 Subject: [PATCH 04/73] Docs: add more info for docker production setup (#1134) Missing .env variables can result in some functions crashing. --- docs/deployment-with-docker.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 5025cdd37..d5983e603 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -37,6 +37,13 @@ root directory of this project as a starting point. Add your own variables to th file won't be tracked by git by default so you'll have to make sure to use some other mechanism to copy your secret if you are relying solely on git. +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 `DJANGO_SENTRY_DSN` variable. This should be enough to report crashes to Sentry. + +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. + +.. _sentry.io: https://sentry.io/welcome +.. _Mailgun: https://mailgun.com + HTTPS is on by default ---------------------- From 706c324e6aa9c3eecdf611ea1663c469ba41cc9b Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Mon, 24 Apr 2017 23:56:27 +0300 Subject: [PATCH 05/73] Remove files conventional to opensource projects only (#1137) --- hooks/post_gen_project.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ba54a5a44..5e1eff9bd 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -201,6 +201,16 @@ def remove_elasticbeanstalk(): PROJECT_DIRECTORY, filename )) +def remove_open_source_files(): + """ + Removes files conventional to opensource projects only. + """ + for filename in ["CONTRIBUTORS.txt"]: + os.remove(os.path.join( + PROJECT_DIRECTORY, filename + )) + + # IN PROGRESS # def copy_doc_files(project_directory): # cookiecutters_dir = DEFAULT_CONFIG['cookiecutters_dir'] @@ -283,3 +293,7 @@ if '{{ cookiecutter.open_source_license}}' != 'GPLv3': # 12. Remove Elastic Beanstalk files if '{{ cookiecutter.use_elasticbeanstalk_experimental }}'.lower() != 'y': remove_elasticbeanstalk() + +# 13. Remove files conventional to opensource projects only. +if '{{ cookiecutter.open_source_license }}' == 'Not open source': + remove_open_source_files() \ No newline at end of file From f5ccce4ef807c32c7d8331303a66d288c5d7ba97 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 25 Apr 2017 00:12:30 +0300 Subject: [PATCH 06/73] Switch from runtime- to compile-time set production django docker service (#1144) Extends #971 --- {{cookiecutter.project_slug}}/compose/django/Dockerfile | 1 + {{cookiecutter.project_slug}}/docker-compose.yml | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/django/Dockerfile index fdccf7f50..7b2e51f9c 100644 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/django/Dockerfile @@ -10,6 +10,7 @@ RUN pip install -r /requirements/production.txt \ COPY . /app RUN chown -R django /app +USER django COPY ./compose/django/gunicorn.sh /gunicorn.sh COPY ./compose/django/entrypoint.sh /entrypoint.sh diff --git a/{{cookiecutter.project_slug}}/docker-compose.yml b/{{cookiecutter.project_slug}}/docker-compose.yml index f0c48406e..b586cbf3b 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.yml @@ -16,7 +16,6 @@ services: build: context: . dockerfile: ./compose/django/Dockerfile - user: django depends_on: - postgres - redis @@ -63,7 +62,6 @@ services: build: context: . dockerfile: ./compose/django/Dockerfile - user: django env_file: .env depends_on: - postgres @@ -74,7 +72,6 @@ services: build: context: . dockerfile: ./compose/django/Dockerfile - user: django env_file: .env depends_on: - postgres From bd487e8ff92a57daa94b8401feac653d65e16513 Mon Sep 17 00:00:00 2001 From: Alexandre Provencio Date: Mon, 24 Apr 2017 19:42:46 -0300 Subject: [PATCH 07/73] Fix docker's letsencrypt renewal command (#942) --- 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 d5983e603..ac4af6e0c 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -109,7 +109,7 @@ If you would like to set up autorenewal of your certificates, the following comm #!/bin/bash cd docker-compose run --rm --name certbot certbot bash -c "sleep 6 && certbot certonly --standalone -d {{ cookiecutter.domain_name }} --text --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --standalone-supported-challenges http-01" - docker exec pearl_nginx_1 nginx -s reload + docker exec {{ cookiecutter.project_name }}_nginx_1 nginx -s reload And then set a cronjob by running `crontab -e` and placing in it (period can be adjusted as desired):: From 9d69bcc10c572290201511c5379407edd07ed095 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 25 Apr 2017 01:43:36 +0300 Subject: [PATCH 08/73] Add a pre-hook that checks the python version (#1142) Closes #1141 --- hooks/pre_gen_project.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index cd31774e0..c7a68450b 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -9,3 +9,23 @@ docker = '{{ cookiecutter.use_docker }}'.lower() if elasticbeanstalk == 'y' and (heroku == 'y' or docker == 'y'): raise Exception("Cookiecutter Django's EXPERIMENTAL Elastic Beanstalk support is incompatible with Heroku and Docker setups.") + +if docker == 'n': + import sys + + python_major_version = sys.version_info[0] + + if python_major_version == 2: + sys.stdout.write("WARNING: Cookiecutter Django does not support Python 2! Stability is guaranteed with Python 3.4+ only. Are you sure you want to proceed? (y/n)") + + yes_options = set(['y']) + no_options = set(['n', '']) + choice = raw_input().lower() + if choice in no_options: + sys.exit(1) + elif choice in yes_options: + pass + else: + sys.stdout.write("Please respond with %s or %s" + % (', '.join([o for o in yes_options if not o == '']) + , ', '.join([o for o in no_options if not o == '']))) From 3fe9ebaaf04e76137978cb6b7e45376c1682d1cc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 25 Apr 2017 06:04:16 -0700 Subject: [PATCH 09/73] Update django-redis from 4.7.0 to 4.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 7fe56d76d..f61d5a698 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -47,7 +47,7 @@ awesome-slugify==1.6.5 pytz==2017.2 # Redis support -django-redis==4.7.0 +django-redis==4.8.0 redis>=2.10.5 {% if cookiecutter.use_celery == "y" %} From c0261189fb1af1863d14fceae0b16c1f6e9b70a9 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Tue, 25 Apr 2017 11:25:08 -0700 Subject: [PATCH 10/73] Added TSD 1.11 to the README --- README.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 80141a2ef..9b26ee68b 100644 --- a/README.rst +++ b/README.rst @@ -263,14 +263,14 @@ Support This Project This project is maintained by volunteers. Support their efforts by spreading the word about: -Two Scoops Press -~~~~~~~~~~~~~~~~~~ +Two Scoops of Django 1.11 +~~~~~~~~~~~~~~~~~~~~~~~~~ -.. image:: https://cdn.shopify.com/s/files/1/0304/6901/t/2/assets/logo.png?11985289740589874793 - :name: Two Scoops Press +.. image:: https://cdn.shopify.com/s/files/1/0304/6901/files/tsd-111-alpha-470x235.jpg?2934688328290951771 + :name: Two Scoops of Django 1.11 Cover :align: center - :alt: Two Scoops Press - :target: https://twoscoopspress.com + :alt: Two Scoops of Django + :target: http://twoscoopspress.org/products/two-scoops-of-django-1-11 Two Scoops Press brings you the best dairy-themed Django references in the universe From 1cabb7ddc0284106f14fc5d4233c46c55d379360 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Tue, 25 Apr 2017 11:25:43 -0700 Subject: [PATCH 11/73] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9b26ee68b..ecd56ff1e 100644 --- a/README.rst +++ b/README.rst @@ -272,7 +272,7 @@ Two Scoops of Django 1.11 :alt: Two Scoops of Django :target: http://twoscoopspress.org/products/two-scoops-of-django-1-11 -Two Scoops Press brings you the best dairy-themed Django references in the universe +Two Scoops of Django is the best dairy-themed Django references in the universe pyup ~~~~~~~~~~~~~~~~~~ From 095d7417b880a14063dbaa15f5c58eb734f3e2ed Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Tue, 25 Apr 2017 20:04:20 -0700 Subject: [PATCH 12/73] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ecd56ff1e..b3ad3ab35 100644 --- a/README.rst +++ b/README.rst @@ -272,7 +272,7 @@ Two Scoops of Django 1.11 :alt: Two Scoops of Django :target: http://twoscoopspress.org/products/two-scoops-of-django-1-11 -Two Scoops of Django is the best dairy-themed Django references in the universe +Two Scoops of Django is the best dairy-themed Django reference in the universe pyup ~~~~~~~~~~~~~~~~~~ From a2666a8b4162b82962d0bdcfc10bf40479086ee5 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 27 Apr 2017 02:18:57 -0700 Subject: [PATCH 13/73] Update django-allauth from 0.31.0 to 0.32.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 7fe56d76d..56fce4085 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -30,7 +30,7 @@ argon2-cffi==16.3.0 # For user registration, either via email or social # Well-built with regular release cycles! -django-allauth==0.31.0 +django-allauth==0.32.0 {% if cookiecutter.windows == 'y' -%} # On Windows, you must download/install psycopg2 manually From 8beb5b40b24e04a0261729054f9320e12c0a608d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 28 Apr 2017 11:09:13 -0700 Subject: [PATCH 14/73] Update pillow from 4.1.0 to 4.1.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 7fe56d76d..10a10893a 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ django-crispy-forms==1.6.1 django-model-utils==3.0.0 # Images -Pillow==4.1.0 +Pillow==4.1.1 # Password storage argon2-cffi==16.3.0 From 9037fb57f329beddd973a6ba15aaaf6c59541437 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Sat, 29 Apr 2017 16:59:05 +0300 Subject: [PATCH 15/73] Fix #1150 (#1151) Fix #1150 --- {{cookiecutter.project_slug}}/compose/django/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/django/Dockerfile index 7b2e51f9c..781f9b8d9 100644 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/django/Dockerfile @@ -8,10 +8,6 @@ RUN pip install -r /requirements/production.txt \ && groupadd -r django \ && useradd -r -g django django -COPY . /app -RUN chown -R django /app -USER django - COPY ./compose/django/gunicorn.sh /gunicorn.sh COPY ./compose/django/entrypoint.sh /entrypoint.sh RUN sed -i 's/\r//' /entrypoint.sh \ @@ -21,6 +17,11 @@ RUN sed -i 's/\r//' /entrypoint.sh \ && chmod +x /gunicorn.sh \ && chown django /gunicorn.sh +COPY . /app + +RUN chown -R django /app +USER django + WORKDIR /app ENTRYPOINT ["/entrypoint.sh"] From fb0aaced34d95d67a31b90b5027dcd1f0cba7efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Sat, 29 Apr 2017 18:57:23 -0300 Subject: [PATCH 16/73] change [pep8] to [pycodestyle] on setup.cfg use [pycodestyle] instead of [pep8] on setup.cfg because [pep8] section is deprecated after 2.1.0 version of pycodestyle --- {{cookiecutter.project_slug}}/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg index c18b80d95..2b26ba61f 100644 --- a/{{cookiecutter.project_slug}}/setup.cfg +++ b/{{cookiecutter.project_slug}}/setup.cfg @@ -2,6 +2,6 @@ max-line-length = 120 exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules -[pep8] +[pycodestyle] max-line-length = 120 exclude=.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules From df4bac167f4f1ba7e9b5666a7d0f7922028703ef Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 30 Apr 2017 14:35:19 -0700 Subject: [PATCH 17/73] Update ipdb from 0.10.2 to 0.10.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 9589fd732..69d6ee366 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -13,7 +13,7 @@ factory-boy==2.8.1 django-debug-toolbar==1.7 # improved REPL -ipdb==0.10.2 +ipdb==0.10.3 pytest-django==3.1.2 pytest-sugar==0.8.0 From eb71aecc32968607faa41343e2363883126193be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cohen?= Date: Sat, 6 May 2017 14:43:26 +0200 Subject: [PATCH 18/73] Optimize Django Dockerfile (#1158) --- .../compose/django/Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/django/Dockerfile index 781f9b8d9..618533f7d 100644 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/django/Dockerfile @@ -1,15 +1,16 @@ FROM python:3.5 + ENV PYTHONUNBUFFERED 1 +RUN groupadd -r django \ + && useradd -r -g django django + # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements +RUN pip install --no-cache-dir -r /requirements/production.txt \ + && rm -rf /requirements -RUN pip install -r /requirements/production.txt \ - && groupadd -r django \ - && useradd -r -g django django - -COPY ./compose/django/gunicorn.sh /gunicorn.sh -COPY ./compose/django/entrypoint.sh /entrypoint.sh +COPY ./compose/django/gunicorn.sh ./compose/django/entrypoint.sh / RUN sed -i 's/\r//' /entrypoint.sh \ && sed -i 's/\r//' /gunicorn.sh \ && chmod +x /entrypoint.sh \ @@ -20,6 +21,7 @@ RUN sed -i 's/\r//' /entrypoint.sh \ COPY . /app RUN chown -R django /app + USER django WORKDIR /app From 8d7fd5ea06acea5749ee3d514b814a153e84efa9 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 6 May 2017 14:48:47 +0200 Subject: [PATCH 19/73] Update django-debug-toolbar from 1.7 to 1.8 (#1156) --- {{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 69d6ee366..00fa1b32b 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -10,7 +10,7 @@ Werkzeug==0.12.1 django-test-plus==1.0.17 factory-boy==2.8.1 -django-debug-toolbar==1.7 +django-debug-toolbar==1.8 # improved REPL ipdb==0.10.3 From 7125d5c4479f8f4c38a09d7cea1b1da3e8265a97 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 6 May 2017 05:49:21 -0700 Subject: [PATCH 20/73] Update django-extensions from 1.7.8 to 1.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 00fa1b32b..23b487988 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -5,7 +5,7 @@ coverage==4.3.4 django-coverage-plugin==1.5.0 Sphinx==1.5.5 -django-extensions==1.7.8 +django-extensions==1.7.9 Werkzeug==0.12.1 django-test-plus==1.0.17 factory-boy==2.8.1 From 64dce4b7d1e027ccfef1d00a4b0252c54328a3e9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 7 May 2017 22:17:21 -0700 Subject: [PATCH 21/73] Update coverage from 4.3.4 to 4.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 00fa1b32b..16a77bb4a 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ # Local development dependencies go here -r base.txt -coverage==4.3.4 +coverage==4.4 django-coverage-plugin==1.5.0 Sphinx==1.5.5 From 451bee63ace469c12f2daaf99952d3415899c208 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 7 May 2017 22:17:23 -0700 Subject: [PATCH 22/73] Update coverage from 4.3.4 to 4.4 --- {{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 03cade464..7fdeeb4a2 100644 --- a/{{cookiecutter.project_slug}}/requirements/test.txt +++ b/{{cookiecutter.project_slug}}/requirements/test.txt @@ -7,7 +7,7 @@ psycopg2==2.7.1 {%- endif %} -coverage==4.3.4 +coverage==4.4 flake8==3.3.0 # pyup: != 2.6.0 django-test-plus==1.0.17 factory-boy==2.8.1 From cdebc13edc628c32992915065634ab707f01e177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Wed, 10 May 2017 10:51:49 -0300 Subject: [PATCH 23/73] update celery to 3.1.25 --- {{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 22439b9bf..31724e3ab 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -51,7 +51,7 @@ django-redis==4.8.0 redis>=2.10.5 {% if cookiecutter.use_celery == "y" %} -celery==3.1.24 +celery==3.1.25 {% endif %} {% if cookiecutter.use_compressor == "y" %} From 22e47a5dfd60c701ff3c565b95054a7c30bde0b8 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Thu, 11 May 2017 08:37:17 -0700 Subject: [PATCH 24/73] Update the support section --- README.rst | 56 +++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/README.rst b/README.rst index b3ad3ab35..39c5c7606 100644 --- a/README.rst +++ b/README.rst @@ -85,6 +85,36 @@ Constraints * Uses PostgreSQL everywhere (9.2+) * Environment variables for configuration (This won't work with Apache/mod_wsgi except on AWS ELB). +Support this Project! +---------------------- + +This project is run by volunteers. Please support them in their efforts to maintain and improve Cookiecutter Django: + +* https://www.patreon.com/danielroygreenfeld: Project lead. Expertise in AWS ELB and Django. + +Organizations that support the maintainers: + +Two Scoops of Django 1.11 +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. image:: https://cdn.shopify.com/s/files/1/0304/6901/files/tsd-111-alpha-470x235.jpg?2934688328290951771 + :name: Two Scoops of Django 1.11 Cover + :align: center + :alt: Two Scoops of Django + :target: http://twoscoopspress.org/products/two-scoops-of-django-1-11 + +Two Scoops of Django is the best dairy-themed Django reference in the universe + +pyup +~~~~~~~~~~~~~~~~~~ + +.. image:: https://pyup.io/static/images/logo.png + :name: pyup + :align: center + :alt: pyup + :target: https://pyup.io/ + +Pyup brings you automated security and dependency updates used by Google and other organizations. Free for open source projects! Usage ------ @@ -258,31 +288,5 @@ Code of Conduct Everyone interacting in the Cookiecutter project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. -Support This Project ---------------------------- - -This project is maintained by volunteers. Support their efforts by spreading the word about: - -Two Scoops of Django 1.11 -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. image:: https://cdn.shopify.com/s/files/1/0304/6901/files/tsd-111-alpha-470x235.jpg?2934688328290951771 - :name: Two Scoops of Django 1.11 Cover - :align: center - :alt: Two Scoops of Django - :target: http://twoscoopspress.org/products/two-scoops-of-django-1-11 - -Two Scoops of Django is the best dairy-themed Django reference in the universe - -pyup -~~~~~~~~~~~~~~~~~~ - -.. image:: https://pyup.io/static/images/logo.png - :name: pyup - :align: center - :alt: pyup - :target: https://pyup.io/ - -Pyup brings you automated security and dependency updates used by Google and other organizations. Free for open source projects! .. _`PyPA Code of Conduct`: https://www.pypa.io/en/latest/code-of-conduct/ From 5fab2f4bf5645fba2c98eacb49630bb3c33ed696 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Thu, 11 May 2017 08:38:13 -0700 Subject: [PATCH 25/73] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 39c5c7606..83c9468f9 100644 --- a/README.rst +++ b/README.rst @@ -92,7 +92,7 @@ This project is run by volunteers. Please support them in their efforts to maint * https://www.patreon.com/danielroygreenfeld: Project lead. Expertise in AWS ELB and Django. -Organizations that support the maintainers: +Projects that provide financial support to the maintainers: Two Scoops of Django 1.11 ~~~~~~~~~~~~~~~~~~~~~~~~~ From 89bc1212b3db591d509a8f69464a360fc4feda67 Mon Sep 17 00:00:00 2001 From: Delio Castillo Date: Fri, 12 May 2017 09:23:22 -0700 Subject: [PATCH 26/73] Fixes docker file when using letsencrypt. Adds ps command to nginx image for start.sh to be able to run without errors (#1154) --- {{cookiecutter.project_slug}}/compose/nginx/Dockerfile | 3 +++ {{cookiecutter.project_slug}}/docker-compose.yml | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/nginx/Dockerfile b/{{cookiecutter.project_slug}}/compose/nginx/Dockerfile index 7ab10d4d6..25b48cd95 100644 --- a/{{cookiecutter.project_slug}}/compose/nginx/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/nginx/Dockerfile @@ -2,6 +2,9 @@ FROM nginx:latest ADD nginx.conf /etc/nginx/nginx.conf {% if cookiecutter.use_lets_encrypt == 'y' and cookiecutter.use_docker == 'y' %} +# installs the `ps` command in the nginx image +RUN apt-get update && apt-get install -y procps + ADD start.sh /start.sh ADD nginx-secure.conf /etc/nginx/nginx-secure.conf ADD dhparams.pem /etc/ssl/private/dhparams.pem diff --git a/{{cookiecutter.project_slug}}/docker-compose.yml b/{{cookiecutter.project_slug}}/docker-compose.yml index b586cbf3b..5c81ad982 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.yml @@ -28,14 +28,12 @@ services: - django {% if cookiecutter.use_lets_encrypt == 'y' %} - certbot + environment: + - MY_DOMAIN_NAME={{ cookiecutter.domain_name }} {% endif %} ports: - "0.0.0.0:80:80" {% if cookiecutter.use_lets_encrypt == 'y' %} - environment: - - MY_DOMAIN_NAME={{ cookiecutter.domain_name }} - ports: - - "0.0.0.0:80:80" - "0.0.0.0:443:443" volumes: - /etc/letsencrypt:/etc/letsencrypt From 7e084c2a7644bd0b82e615b08ad7cd64eada17a4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 14 May 2017 13:10:35 -0700 Subject: [PATCH 27/73] Update sphinx from 1.5.5 to 1.5.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 151fcdced..427c0af05 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ coverage==4.4 django-coverage-plugin==1.5.0 -Sphinx==1.5.5 +Sphinx==1.5.6 django-extensions==1.7.9 Werkzeug==0.12.1 django-test-plus==1.0.17 From 3ae3e74aae725f96259b29a725025f8c764f6ff1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 14 May 2017 23:39:37 -0700 Subject: [PATCH 28/73] Update coverage from 4.4 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 151fcdced..cefa721c7 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -1,7 +1,7 @@ # Local development dependencies go here -r base.txt -coverage==4.4 +coverage==4.4.1 django-coverage-plugin==1.5.0 Sphinx==1.5.5 From eed7233c1b8c76ddbe3d5230293ff49ed67577cc Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 14 May 2017 23:39:38 -0700 Subject: [PATCH 29/73] Update coverage from 4.4 to 4.4.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 7fdeeb4a2..0889aaa4f 100644 --- a/{{cookiecutter.project_slug}}/requirements/test.txt +++ b/{{cookiecutter.project_slug}}/requirements/test.txt @@ -7,7 +7,7 @@ psycopg2==2.7.1 {%- endif %} -coverage==4.4 +coverage==4.4.1 flake8==3.3.0 # pyup: != 2.6.0 django-test-plus==1.0.17 factory-boy==2.8.1 From 27fb6e1a0a4c623f7a50cf5f05863ba7abaf558f Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Mon, 15 May 2017 15:01:19 +0300 Subject: [PATCH 30/73] Fix linters.rst sphinx warnings (#1167) * Fix linters.rst sphinx warnings * Stick with `` instead of ` --- docs/linters.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/linters.rst b/docs/linters.rst index c2f76f352..4750e1617 100644 --- a/docs/linters.rst +++ b/docs/linters.rst @@ -14,7 +14,7 @@ To run flake8: The config for flake8 is located in setup.cfg. It specifies: * Set max line length to 120 chars -* Exclude .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules +* Exclude ``.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules`` pylint ------ @@ -40,4 +40,4 @@ This is included in flake8's checks, but you can also run it separately to see a The config for pep8 is located in setup.cfg. It specifies: * Set max line length to 120 chars -* Exclude .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules \ No newline at end of file +* Exclude ``.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules`` From fa03a69b07dac7148836b0c3ee33993e3e29b40b Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 May 2017 10:08:10 +0200 Subject: [PATCH 31/73] Update werkzeug from 0.12.1 to 0.12.2 (#1170) --- {{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 35f0a62f4..75469c097 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -6,7 +6,7 @@ django-coverage-plugin==1.5.0 Sphinx==1.5.6 django-extensions==1.7.9 -Werkzeug==0.12.1 +Werkzeug==0.12.2 django-test-plus==1.0.17 factory-boy==2.8.1 From 215879aa3099ec6b60f0fb047a4982a2dc21c607 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 16 May 2017 23:08:39 +0200 Subject: [PATCH 32/73] Update sphinx from 1.5.6 to 1.6.1 (#1171) --- {{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 75469c097..1f62f3093 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ coverage==4.4.1 django-coverage-plugin==1.5.0 -Sphinx==1.5.6 +Sphinx==1.6.1 django-extensions==1.7.9 Werkzeug==0.12.2 django-test-plus==1.0.17 From 7c7176d4f99e9790dcd3d897be96a7e83d38443f Mon Sep 17 00:00:00 2001 From: Cristian Samaniego Date: Fri, 19 May 2017 11:26:20 -0700 Subject: [PATCH 33/73] Fix ipdb docker-compose needed command (#1175) 'run' must be after the -f flag --- docs/developing-locally-docker.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 19c24f8e5..140f99507 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -121,7 +121,7 @@ Then you may need to run the following for it to work as desired: :: - $ docker-compose run -f dev.yml --service-ports django + $ docker-compose -f dev.yml run --service-ports django django-debug-toolbar From c86989eb96ef855f35e644aef6c996b137f679a5 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 22 May 2017 22:51:29 +0200 Subject: [PATCH 34/73] Update django-anymail from 0.9 to 0.10 (#1177) --- {{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 b88ff65c6..297535819 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -24,7 +24,7 @@ Collectfast==0.5.2 # Email backends for Mailgun, Postmark, SendGrid and more # ------------------------------------------------------- -django-anymail==0.9 +django-anymail==0.10 {% if cookiecutter.use_sentry_for_error_reporting == "y" -%} # Raven is the Sentry client From 765764a4a2dfba1cafd2c52a3a9d2de49945e713 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 25 May 2017 15:02:53 -0700 Subject: [PATCH 35/73] Update raven from 6.0.0 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 297535819..d1ff5c320 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -29,7 +29,7 @@ django-anymail==0.10 {% if cookiecutter.use_sentry_for_error_reporting == "y" -%} # Raven is the Sentry client # -------------------------- -raven==6.0.0 +raven==6.1.0 {%- endif %} {% if cookiecutter.use_opbeat == "y" -%} From cb46ed45840c7c8cb233bfe82194049025e445cd Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 26 May 2017 22:22:16 +0200 Subject: [PATCH 36/73] Update pytest from 3.0.7 to 3.1.0 (#1178) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ebc618046..344c1ae50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ sh==1.12.13 binaryornot==0.4.3 # Testing -pytest==3.0.7 +pytest==3.1.0 pep8==1.7.0 pyflakes==1.5.0 tox==2.7.0 From 890c7cbf4b59f4e722502ea30e647ed1ac91ba39 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Fri, 26 May 2017 22:22:55 +0200 Subject: [PATCH 37/73] Update boto from 2.46.1 to 2.47.0 (#1179) --- {{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 297535819..ec7e9733f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,7 +16,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ -boto==2.46.1 +boto==2.47.0 django-storages-redux==1.3.2 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.5.2 From 798bf0639e3d389384bc2a2f7d0164308871bea6 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sun, 28 May 2017 13:43:56 -0700 Subject: [PATCH 38/73] Update sphinx from 1.6.1 to 1.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 1f62f3093..437eee598 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ coverage==4.4.1 django-coverage-plugin==1.5.0 -Sphinx==1.6.1 +Sphinx==1.6.2 django-extensions==1.7.9 Werkzeug==0.12.2 django-test-plus==1.0.17 From 85782f72af148dc7053a56fef81d864f221bb786 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 31 May 2017 20:54:41 +0200 Subject: [PATCH 39/73] Update pytest from 3.1.0 to 3.1.1 (#1183) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 344c1ae50..2736cce29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ sh==1.12.13 binaryornot==0.4.3 # Testing -pytest==3.1.0 +pytest==3.1.1 pep8==1.7.0 pyflakes==1.5.0 tox==2.7.0 From 1ddc3fcef823f571f7b2c5673df7b2b910852e00 Mon Sep 17 00:00:00 2001 From: Cristian Samaniego Date: Fri, 2 Jun 2017 12:47:53 -0700 Subject: [PATCH 40/73] Fix typo and deprecated option in certbot command (#1185) The --standalone-supported-challenges option has been deprecated since certbot version 0.9.0. --- docs/deployment-with-docker.rst | 6 +++--- {{cookiecutter.project_slug}}/docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index ac4af6e0c..0c7118374 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -91,13 +91,13 @@ Replace: :: - command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --text --agree-tos --email mjsisley@relawgo.com --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --standalone-supported-challenges http-01" + command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --test --agree-tos --email mjsisley@relawgo.com --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01" With: :: - command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} -d www.{{ cookiecutter.domain_name }} -d etc.{{ cookiecutter.domain_name }} --text --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --standalone-supported-challenges http-01" + command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} -d www.{{ cookiecutter.domain_name }} -d etc.{{ cookiecutter.domain_name }} --test --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01" Please be cognizant of Certbot/Letsencrypt certificate requests limits when getting this set up. The provide a test server that does not count against the limit while you are getting set up. @@ -108,7 +108,7 @@ If you would like to set up autorenewal of your certificates, the following comm #!/bin/bash cd - docker-compose run --rm --name certbot certbot bash -c "sleep 6 && certbot certonly --standalone -d {{ cookiecutter.domain_name }} --text --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --standalone-supported-challenges http-01" + docker-compose run --rm --name certbot certbot bash -c "sleep 6 && certbot certonly --standalone -d {{ cookiecutter.domain_name }} --test --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01" docker exec {{ cookiecutter.project_name }}_nginx_1 nginx -s reload And then set a cronjob by running `crontab -e` and placing in it (period can be adjusted as desired):: diff --git a/{{cookiecutter.project_slug}}/docker-compose.yml b/{{cookiecutter.project_slug}}/docker-compose.yml index 5c81ad982..af54b4442 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.yml @@ -41,7 +41,7 @@ services: certbot: image: quay.io/letsencrypt/letsencrypt - command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --text --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --standalone-supported-challenges http-01" + command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --test --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01" entrypoint: "" volumes: - /etc/letsencrypt:/etc/letsencrypt From 847a5fdbc6587c537e9c64eab4bf4f2c77a45f71 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Tue, 6 Jun 2017 20:19:10 -0700 Subject: [PATCH 41/73] Update sh from 1.12.13 to 1.12.14 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2736cce29..21d037d82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ cookiecutter==1.5.1 flake8==3.3.0 # pyup: != 2.6.0 -sh==1.12.13 +sh==1.12.14 binaryornot==0.4.3 # Testing From 46af6b476010cb2410f7bf3751455f7ba53b54e6 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 7 Jun 2017 17:26:25 +0200 Subject: [PATCH 42/73] Update gevent from 1.2.1 to 1.2.2 (#1186) --- {{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 0cb1714bf..4d56f27f9 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -11,7 +11,7 @@ psycopg2==2.7.1 # WSGI Handler # ------------------------------------------------ -gevent==1.2.1 +gevent==1.2.2 gunicorn==19.7.1 # Static and Media Storage From a286e32e2b875a738e08b10025a1430fda3e75ec Mon Sep 17 00:00:00 2001 From: John Franey Date: Wed, 7 Jun 2017 12:46:20 -0300 Subject: [PATCH 43/73] Gulpfile child process spawn (#1074) * Update gulpfile to use child_process.spawn Use child_process.spawn in place of child_process exec to ensure that console output is captured by Gulp. Fixes #939 * Remove extra line --- {{cookiecutter.project_slug}}/gulpfile.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index 69ff0aaa2..b67a7bee9 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -16,7 +16,7 @@ var gulp = require('gulp'), pixrem = require('gulp-pixrem'), uglify = require('gulp-uglify'), imagemin = require('gulp-imagemin'), - exec = require('child_process').exec, + spawn = require('child_process').spawn, runSequence = require('run-sequence'), browserSync = require('browser-sync').create(), reload = browserSync.reload; @@ -73,10 +73,11 @@ gulp.task('imgCompression', function(){ }); // Run django server -gulp.task('runServer', function() { - exec('python manage.py runserver', function (err, stdout, stderr) { - console.log(stdout); - console.log(stderr); +gulp.task('runServer', function(cb) { + var cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'}); + cmd.on('close', function(code) { + console.log('runServer exited with code ' + code); + cb(code); }); }); From 611159eecff6d58e1655342778598cc57a9626df Mon Sep 17 00:00:00 2001 From: mekhami Date: Thu, 8 Jun 2017 14:55:29 -0500 Subject: [PATCH 44/73] Create deployment-with-docker.rst (#1189) Just a little extra clarity on postgres and the .env file, inspired by #1188. --- docs/deployment-with-docker.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index 0c7118374..0a5623a4d 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -37,6 +37,8 @@ root directory of this project as a starting point. Add your own variables to th file won't be tracked by git by default so you'll have to make sure to use some other mechanism to copy your secret if you are relying solely on git. +It is **highly recommended** that before you build your production application, you set your POSTGRES_USER value here. This will create a non-default user for the postgres image. If you do not set this user before building the application, the default user 'postgres' will be created, and this user will not be able to create or restore backups. + 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 `DJANGO_SENTRY_DSN` variable. This should be enough to report crashes to Sentry. 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 d34aa71038648f90fdf4a4ca48e6ef5971f9fd6c Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sat, 10 Jun 2017 12:10:46 +0200 Subject: [PATCH 45/73] Update pytest from 3.1.1 to 3.1.2 (#1190) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 21d037d82..6a54b115b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ sh==1.12.14 binaryornot==0.4.3 # Testing -pytest==3.1.1 +pytest==3.1.2 pep8==1.7.0 pyflakes==1.5.0 tox==2.7.0 From 4aff5971d1c8f25c6a778e90ff397085cf4377d6 Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Mon, 12 Jun 2017 12:38:00 -0400 Subject: [PATCH 46/73] Automatic recompilation of Bootstrap with user-defined variables (#1181) Allow for dynamic bootstrap compilation Exclude sublime artifacts Make custom bootstrap vars file Add custom bootstrap compilation Add cookiecutter option Use the right name for the file Add explanation to generated README Add self to contributors Remove sublime exclusion --- CONTRIBUTORS.rst | 1 + cookiecutter.json | 1 + {{cookiecutter.project_slug}}/Gruntfile.js | 6 +++ {{cookiecutter.project_slug}}/README.rst | 9 ++++ .../static/sass/custom_bootstrap_vars.scss | 0 .../static/sass/project.scss | 54 +++++++++++++++++++ 6 files changed, 71 insertions(+) create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/custom_bootstrap_vars.scss diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 11324a50a..215e58ee6 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -56,6 +56,7 @@ Listed in alphabetical order. Areski Belaid `@areski`_ Ashley Camba Barclay Gauld `@yunti`_ + Ben Warren `@bwarren2` Ben Lopatin Benjamin Abel Bo Lopker `@blopker`_ diff --git a/cookiecutter.json b/cookiecutter.json index 4450e6933..5b443493c 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -21,5 +21,6 @@ "postgresql_version": ["9.6", "9.5", "9.4", "9.3", "9.2"], "js_task_runner": ["Gulp", "Grunt", "None"], "use_lets_encrypt": "n", + "custom_bootstrap_compilation": "n", "open_source_license": ["MIT", "BSD", "GPLv3", "Apache Software License 2.0", "Not open source"] } diff --git a/{{cookiecutter.project_slug}}/Gruntfile.js b/{{cookiecutter.project_slug}}/Gruntfile.js index e5fbcceed..6900c4e08 100644 --- a/{{cookiecutter.project_slug}}/Gruntfile.js +++ b/{{cookiecutter.project_slug}}/Gruntfile.js @@ -60,6 +60,9 @@ module.exports = function (grunt) { dev: { options: { outputStyle: 'nested', +{% if cookiecutter.custom_bootstrap_compilation == 'y' %} + includePaths: ['bower_components/bootstrap-sass/assets/stylesheets/bootstrap/'], +{% endif %} sourceMap: false, precision: 10 }, @@ -70,6 +73,9 @@ module.exports = function (grunt) { dist: { options: { outputStyle: 'compressed', +{% if cookiecutter.custom_bootstrap_compilation == 'y' %} + includePaths: ['bower_components/bootstrap-sass/assets/stylesheets/bootstrap/'], +{% endif %} sourceMap: false, precision: 10 }, diff --git a/{{cookiecutter.project_slug}}/README.rst b/{{cookiecutter.project_slug}}/README.rst index 0248eee39..924e238dd 100644 --- a/{{cookiecutter.project_slug}}/README.rst +++ b/{{cookiecutter.project_slug}}/README.rst @@ -145,3 +145,12 @@ See detailed `cookiecutter-django Elastic Beanstalk documentation`_. .. _`cookiecutter-django Docker documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-elastic-beanstalk.html {% endif %} +{% if cookiecutter.custom_bootstrap_compilation == "y" %} +Custom Bootstrap Compilation +^^^^^^ + +To get automatic Bootstrap recompilation with variables of your choice, install bootstrap sass (`bower install bootstrap-sass`) and tweak your variables in `static/sass/custom_bootstrap_vars`. + +(You can find a list of available variables [in the bootstrap-sass source](https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_variables.scss), or get explanations on them in the [Bootstrap docs](https://getbootstrap.com/customize/).) + +{% endif %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/custom_bootstrap_vars.scss b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/custom_bootstrap_vars.scss new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss index 54632b2d6..8dafa2201 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/sass/project.scss @@ -1,3 +1,57 @@ +{% if cookiecutter.custom_bootstrap_compilation == 'y' %} +@import "variables"; +@import "custom_bootstrap_vars"; +@import "mixins"; + +// Reset and dependencies +@import "normalize"; +@import "print"; +@import "glyphicons"; + +// Core CSS +@import "scaffolding"; +@import "type"; +@import "code"; +@import "grid"; +@import "tables"; +@import "forms"; +@import "buttons"; + +// Components +@import "component-animations"; +@import "dropdowns"; +@import "button-groups"; +@import "input-groups"; +@import "navs"; +@import "navbar"; +@import "breadcrumbs"; +@import "pagination"; +@import "pager"; +@import "labels"; +@import "badges"; +@import "jumbotron"; +@import "thumbnails"; +@import "alerts"; +@import "progress-bars"; +@import "media"; +@import "list-group"; +@import "panels"; +@import "responsive-embed"; +@import "wells"; +@import "close"; + +// Components w/ JavaScript +@import "modals"; +@import "tooltip"; +@import "popovers"; +@import "carousel"; + +// Utility classes +@import "utilities"; +@import "responsive-utilities"; +{% endif %} + + // project specific CSS goes here From ec62188fae01c4cafeedf7689050b441866aa94f Mon Sep 17 00:00:00 2001 From: Emile Petrone Date: Tue, 13 Jun 2017 15:00:14 -0700 Subject: [PATCH 47/73] Fix hard coded email (#1193) --- 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 0a5623a4d..63b1d7c44 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -93,7 +93,7 @@ Replace: :: - command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --test --agree-tos --email mjsisley@relawgo.com --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01" + command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --test --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01" With: From 4b06fe3958ddae837100bcdcab001b6405a202fd Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 22:48:17 +0300 Subject: [PATCH 48/73] =?UTF-8?q?Node.JS=20+=20docker-compose=20=3D=20?= =?UTF-8?q?=E2=99=A5=20(#1128)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Introduce static asset build infrastructure * Enhance gulpfile.js * Introduce node service * BrowserSync debug-only support * Remove newline before BrowserSync debug-only support section * FIx node Dockerfile package.json COPY * Try fiixing node Dockerfile package.json COPY ones again * Switch to `node:7-slim` * Try switching to node:6 To account for possible node:7 docker-compose incompatibiltiy * Revert "Try switching to node:6" This reverts commit 62cc02df1a24d1f25c8b48b5c4126d17f2049144. * Try switcging workdir to /app * Try utilizing relative package.json path * Resetting to the last version working locally with docker-compose 1.11.x * Build upon the latest node:7.9-slim * Stop dockerignoring package.json * Fix typo * Try a different package.json path * Revert "Try a different package.json path" This reverts commit f29f8500b8fde04ae5e8e46256b86ab910cedcca. * Revert "Fix typo" This reverts commit 02033729b51a3fbc9839dac5e9731bf4b541a60c. * Revert "Stop dockerignoring package.json" This reverts commit 63c5491546d3694bfb659b2a17d7cee6365227c6. * Upgrade docker-engine and docker-compose used by Travis CI * Fix .travis.yml comments * Inline docker-engine and docker-compose versions * DEBUG: pwd * Revert "DEBUG: pwd " This reverts commit 6c2ed4321a346a384289c4a0a54576e0010c98f1. * Try copying package.json to the same dir as node Dockerfile's * Revert "Try copying package.json to the same dir as node Dockerfile's" This reverts commit 24340a0783143108cabbb508f1b0d1202fc0d76d. * Try out node:7.9 * Revert "Try out node:7.9" This reverts commit 32286d33c2dc535fe7e20cd6342b1627f1ebf58f. * Revert "Upgrade docker-engine and docker-compose used by Travis CI" * Get rid of npm-check-updates Reason: Reserved for the upcoming PR * Get rid of npm-check Reason: Reserved for the upcoming PR * Get rid of 'standard' npm package Reason: Reserved for the upcoming PR * Clean up package.json * Preserve package.json uncoditionally Since we now have *unconditional* node.js integration, `package.json` must be out there whenever `node` service gets built * Upgrade node service image to 7.10 * Document Node.js-Docker integration * Fix gulpfile.js images region name * Get rid of Gulp migrate task * Document Gulp-Docker integration * Introduce static asset build infrastructure * Enhance gulpfile.js * Introduce node service * BrowserSync debug-only support * Remove newline before BrowserSync debug-only support section * FIx node Dockerfile package.json COPY * Try fiixing node Dockerfile package.json COPY ones again * Switch to `node:7-slim` * Try switching to node:6 To account for possible node:7 docker-compose incompatibiltiy * Revert "Try switching to node:6" This reverts commit 62cc02df1a24d1f25c8b48b5c4126d17f2049144. * Try switcging workdir to /app * Try utilizing relative package.json path * Resetting to the last version working locally with docker-compose 1.11.x * Build upon the latest node:7.9-slim * Stop dockerignoring package.json * Revert "Stop dockerignoring package.json" This reverts commit 63c5491546d3694bfb659b2a17d7cee6365227c6. * Fix typo * Revert "Fix typo" This reverts commit 02033729b51a3fbc9839dac5e9731bf4b541a60c. * Try a different package.json path * Revert "Try a different package.json path" This reverts commit f29f8500b8fde04ae5e8e46256b86ab910cedcca. * Upgrade docker-engine and docker-compose used by Travis CI * Fix .travis.yml comments * Inline docker-engine and docker-compose versions * DEBUG: pwd * Revert "DEBUG: pwd " This reverts commit 6c2ed4321a346a384289c4a0a54576e0010c98f1. * Try copying package.json to the same dir as node Dockerfile's * Revert "Try copying package.json to the same dir as node Dockerfile's" This reverts commit 24340a0783143108cabbb508f1b0d1202fc0d76d. * Try out node:7.9 * Revert "Try out node:7.9" This reverts commit 32286d33c2dc535fe7e20cd6342b1627f1ebf58f. * Revert "Upgrade docker-engine and docker-compose used by Travis CI" * Get rid of npm-check-updates Reason: Reserved for the upcoming PR * Get rid of npm-check Reason: Reserved for the upcoming PR * Get rid of 'standard' npm package Reason: Reserved for the upcoming PR * Clean up package.json * Preserve package.json uncoditionally Since we now have *unconditional* node.js integration, `package.json` must be out there whenever `node` service gets built * Upgrade node service image to 7.10 * Document Node.js-Docker integration * Fix gulpfile.js images region name * Get rid of Gulp migrate task * Document Gulp-Docker integration * Remove Gulp-Docker integraton not supported initialization message --- docs/developing-locally-docker.rst | 8 + docs/gulp-with-docker.rst | 76 +++++++ docs/index.rst | 2 + docs/nodejs-with-docker.rst | 45 ++++ hooks/post_gen_project.py | 8 +- {{cookiecutter.project_slug}}/.gitignore | 1 + .../compose/node/Dockerfile-dev | 11 + .../config/settings/base.py | 3 +- {{cookiecutter.project_slug}}/dev.yml | 17 ++ {{cookiecutter.project_slug}}/gulpfile.js | 212 ++++++++++-------- {{cookiecutter.project_slug}}/package.json | 16 +- .../static/.gitkeep | 0 .../static/css/project.css | 38 ---- .../static/images/.gitkeep | 0 .../static/js/project.js | 21 -- .../static/scripts/.gitkeep | 0 .../static/scripts/js/project.js | 21 ++ .../static/styles/.gitkeep | 0 .../static/styles/css/project.css | 26 +++ .../static/styles/sass/project.scss | 71 ++++++ .../templates/base.html | 11 +- 21 files changed, 423 insertions(+), 164 deletions(-) create mode 100644 docs/gulp-with-docker.rst create mode 100644 docs/nodejs-with-docker.rst create mode 100644 {{cookiecutter.project_slug}}/compose/node/Dockerfile-dev create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/.gitkeep delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/images/.gitkeep delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/.gitkeep create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/.gitkeep create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 140f99507..46ee887a3 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -6,6 +6,8 @@ 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. +.. _devlocdocker-prereq: + Prerequisites ------------- @@ -30,6 +32,9 @@ Currently PostgreSQL (``psycopg2`` python package) is not installed inside Docke 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. + +.. _devlocdocker-build-the-stack: + Build the Stack --------------- @@ -40,6 +45,9 @@ on your development system:: If you want to build the production environment you don't have to pass an argument -f, it will automatically use docker-compose.yml. + +.. _devlocdocker-boot-the-system: + Boot the System --------------- diff --git a/docs/gulp-with-docker.rst b/docs/gulp-with-docker.rst new file mode 100644 index 000000000..1e9b2a184 --- /dev/null +++ b/docs/gulp-with-docker.rst @@ -0,0 +1,76 @@ +Gulp with Docker +================ + +.. index:: gulp, gulpjs, gulpfile, gulpfilejs, docker, docker-compose + +`Gulp`_ support is provided out-of-the-box, ready for use as-is, or with any kind of customizations suiting the specific needs of the project. + +.. _`Gulp`: http://gulpjs.com/ + +*All paths are relative to the generated project's root.* + + +Prerequisites +------------- + +- These :ref:`nodewithdocker-prereq` are satisfied. + + +Overview +-------- + +:ref:`nodewithdocker-overview` Node.js integration details first to get the whole picture. + +Essential aspects of Gulp integration are + +- :code:`./gulpfile.js` with Gulp tasks defined; +- :code:`./{{ cookiecutter.project_slug }}/static/build/` (build directory) with static assets built via Gulp. + +Let us take a closer look at :code:`./gulpfile.js`: + +- paths to static assets are provided by :code:`pathsConfig()`; +- for clarity, related tasks are grouped by :code:`region`: + - :code:`images`: + - :code:`images`: run image-related tasks in parallel, namely: + - :code:`favicons-images`: process favicon images only; + - :code:`nonfavicons-images`: process all images except for favicons. + - :code:`scripts`: + - :code:`scripts`: run script-related tasks in sequence, namely: + - :code:`js-scripts`: process js scripts. + - :code:`styles`: + - :code:`styles`: run script-related tasks in sequence, namely: + - :code:`sass-styles`: process SCSS styles; + - :code:`css-styles`: process CSS styles. + - :code:`build`: + - :code:`build`: run :code:`images`, :code:`scripts`, and :code:`styles` in parallel; + - :code:`clean-build`: clean up build directory: +- the :code:`default` task runs the following ones in sequence: + - :code:`build`; + - :code:`init-browserSync`: initialize `BrowserSync`_; + - :code:`watch`: watch static asset files/directories changes, running BrowserSync on any changes. + +.. _`BrowserSync`: https://www.browsersync.io/ + + +Workflow +-------- + +#. [*skip if done*] :ref:`devlocdocker-build-the-stack`; +#. :ref:`devlocdocker-boot-the-system`. + +By default, :code:`gulp` command gets executed immediately after :code:`node` +container startup (see :code:`./dev.yml` for details) which in turn invokes +the :code:`default` task, so generally one would not need to run any +of the aforementioned tasks manually. However, should the need arise, +oftentimes just a few of the tasks listed above will be used to, for instance, +straightforwardly :code:`build` all assets + +.. code-block:: bash + + $ docker-compose -f dev.yml exec node gulp build + +or build :code:`scripts` selectively + +.. code-block:: bash + + $ docker-compose -f dev.yml exec node gulp scripts diff --git a/docs/index.rst b/docs/index.rst index bfa88f18c..e707365bf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,6 +17,8 @@ Contents: developing-locally-docker settings linters + nodejs-with-docker + gulp-with-docker live-reloading-and-sass-compilation deployment-on-pythonanywhere deployment-on-heroku diff --git a/docs/nodejs-with-docker.rst b/docs/nodejs-with-docker.rst new file mode 100644 index 000000000..468c54087 --- /dev/null +++ b/docs/nodejs-with-docker.rst @@ -0,0 +1,45 @@ +Node.js with Docker +=================== + +.. index:: node, nodejs, docker, docker-compose + +`Node.js`_ support is provided out-of-the-box, ready for use as-is, or with any kind of customizations suiting the specific needs of the project. + +.. _`Node.js`: https://nodejs.org/en/ + +*All paths are relative to the generated project's root.* + + +.. _nodewithdocker-prereq: + +Prerequisites +------------- + +- The project was generated with :code:`use_docker` set to :code:`y`. +- These :ref:`devlocdocker-prereq` are met as well. + + +.. _nodewithdocker-overview: + +Overview +-------- + +Essential aspects of Node.js integration are + +- node docker-compose service (:code:`node`) definition in :code:`./dev.yml`; +- :code:`./compose/node/Dockerfile-dev` defining the :code:`node` image; +- :code:`./node_modules/` 'overlayed' with :code:`/app/node_modules/`, its counterpart from the running instance of :code:`node`. + + +Workflow +-------- + +#. [*skip if done*] :ref:`devlocdocker-build-the-stack`: + - when building :code:`node` image from scratch, dependencies from :code:`package.json` are installed. +#. :ref:`devlocdocker-boot-the-system`. + +To log the running :code:`node` container's activity, + +.. code-block:: bash + + $ docker-compose -f dev.yml logs node diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 5e1eff9bd..c005d9e7e 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -256,7 +256,6 @@ elif '{{ cookiecutter.js_task_runner}}'.lower() == 'grunt': else: remove_gulp_files() remove_grunt_files() - remove_packageJSON_file() # 7. Removes all certbot/letsencrypt files if it isn't going to be used if '{{ cookiecutter.use_lets_encrypt }}'.lower() != 'y': @@ -264,11 +263,10 @@ if '{{ cookiecutter.use_lets_encrypt }}'.lower() != 'y': # 8. Display a warning if use_docker and use_grunt are selected. Grunt isn't # supported by our docker config atm. -if '{{ cookiecutter.js_task_runner }}'.lower() in ['grunt', 'gulp'] and '{{ cookiecutter.use_docker }}'.lower() == 'y': +if '{{ cookiecutter.js_task_runner }}'.lower() in ['grunt'] and '{{ cookiecutter.use_docker }}'.lower() == 'y': print( - "You selected to use docker and a JS task runner. This is NOT supported out of the box for now. You " - "can continue to use the project like you normally would, but you will need to add a " - "js task runner service to your docker configuration manually." + "You selected to use Docker and Grunt task runner. This is NOT supported out of the box for now. You " + "can continue to use the project like you normally would, but you will need to setup Grunt manually." ) # 9. Removes the certbot/letsencrypt files and display a warning if use_lets_encrypt is selected and use_docker isn't. diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index 6a0a3029e..710ba625d 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -79,3 +79,4 @@ staticfiles/ .cache/ +{{ cookiecutter.project_slug }}/static/build/ diff --git a/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev b/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev new file mode 100644 index 000000000..e53fb5049 --- /dev/null +++ b/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev @@ -0,0 +1,11 @@ +FROM node:7.10-slim + +RUN mkdir -p /app + +COPY ./package.json /app + +WORKDIR /app + +RUN npm install && npm cache clean + +ENV PATH ./node_modules/.bin/:$PATH diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 274e28067..5b07086da 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -184,9 +184,10 @@ STATIC_ROOT = str(ROOT_DIR('staticfiles')) # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url STATIC_URL = '/static/' +_STATIC_BUILD_ROOT_DIR_NAME = 'build' # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS STATICFILES_DIRS = [ - str(APPS_DIR.path('static')), + (_STATIC_BUILD_ROOT_DIR_NAME, str(APPS_DIR.path('static').path(_STATIC_BUILD_ROOT_DIR_NAME))), ] # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders diff --git a/{{cookiecutter.project_slug}}/dev.yml b/{{cookiecutter.project_slug}}/dev.yml index 122dea449..7a2d06eb7 100644 --- a/{{cookiecutter.project_slug}}/dev.yml +++ b/{{cookiecutter.project_slug}}/dev.yml @@ -21,6 +21,7 @@ services: depends_on: - postgres{% if cookiecutter.use_mailhog == 'y' %} - mailhog{% endif %} + - node environment: - POSTGRES_USER={{cookiecutter.project_slug}} - USE_DOCKER=yes @@ -48,3 +49,19 @@ services: ports: - "8025:8025" {% endif %} + + node: + build: + context: . + dockerfile: ./compose/node/Dockerfile-dev + volumes: + - .:/app + # http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html + - /app/node_modules + command: "gulp" + ports: + # BrowserSync port. + - "3000:3000" + # BrowserSync UI port. + - "3001:3001" + diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index b67a7bee9..f3278afe5 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -1,105 +1,139 @@ +const gulp = require('gulp') +const pump = require('pump') +const sass = require('gulp-sass') +const pjson = require('./package.json') +const autoprefixer = require('gulp-autoprefixer') +const cleanCSS = require('gulp-clean-css') +const rename = require('gulp-rename') +const pixrem = require('gulp-pixrem') +const concat = require('gulp-concat') +const uglify = require('gulp-uglify') +const imagemin = require('gulp-imagemin') +const clean = require('gulp-clean') +const spawn = require('child_process').spawn +const runSequence = require('run-sequence') +const browserSync = require('browser-sync').create() +const pathsConfig = function (appName) { + this.paths = {} -//////////////////////////////// - //Setup// -//////////////////////////////// + this.paths['app'] = './' + (appName || pjson.name) -// Plugins -var gulp = require('gulp'), - pjson = require('./package.json'), - gutil = require('gulp-util'), - sass = require('gulp-sass'), - autoprefixer = require('gulp-autoprefixer'), - cssnano = require('gulp-cssnano'), - rename = require('gulp-rename'), - del = require('del'), - plumber = require('gulp-plumber'), - pixrem = require('gulp-pixrem'), - uglify = require('gulp-uglify'), - imagemin = require('gulp-imagemin'), - spawn = require('child_process').spawn, - runSequence = require('run-sequence'), - browserSync = require('browser-sync').create(), - reload = browserSync.reload; + this.paths['static'] = this.paths['app'] + '/static' + this.paths['build'] = this.paths['static'] + '/build' -// Relative paths function -var pathsConfig = function (appName) { - this.app = "./" + (appName || pjson.name); + this.paths['buildImages'] = this.paths['build'] + '/images' + this.paths['images'] = this.paths['static'] + '/images' + this.paths['images_files'] = this.paths['images'] + '/*' + this.paths['buildImagesFavicons'] = this.paths['buildImages'] + '/favicons' + this.paths['imagesFavicons'] = this.paths['images'] + '/favicons' + this.paths['imagesFavicons_files'] = this.paths['imagesFavicons'] + '/*' - return { - app: this.app, - templates: this.app + '/templates', - css: this.app + '/static/css', - sass: this.app + '/static/sass', - fonts: this.app + '/static/fonts', - images: this.app + '/static/images', - js: this.app + '/static/js', - } -}; + this.paths['build_scriptsFileName'] = 'scripts.js' + this.paths['scripts'] = this.paths['static'] + '/scripts' + this.paths['scripts_files'] = this.paths['scripts'] + '/**/*' + this.paths['scriptsJs'] = this.paths['scripts'] + '/js' + this.paths['scriptsJs_files'] = this.paths['scriptsJs'] + '/*.js' -var paths = pathsConfig(); + this.paths['build_stylesFileName'] = 'styles.css' + this.paths['styles'] = this.paths['static'] + '/styles' + this.paths['styles_files'] = this.paths['styles'] + '/**/*' + this.paths['stylesSass'] = this.paths['styles'] + '/sass' + this.paths['stylesSass_files'] = this.paths['stylesSass'] + '/*.scss' + this.paths['stylesCss'] = this.paths['styles'] + '/css' + this.paths['stylesCss_files'] = this.paths['stylesCss'] + '/*.css' -//////////////////////////////// - //Tasks// -//////////////////////////////// + this.paths['templates'] = this.paths['app'] + '/templates' + this.paths['templates_files'] = this.paths['templates'] + '/**/*.html' -// Styles autoprefixing and minification -gulp.task('styles', function() { - return gulp.src(paths.sass + '/project.scss') - .pipe(sass().on('error', sass.logError)) - .pipe(plumber()) // Checks for errors - .pipe(autoprefixer({browsers: ['last 2 versions']})) // Adds vendor prefixes - .pipe(pixrem()) // add fallbacks for rem units - .pipe(gulp.dest(paths.css)) - .pipe(rename({ suffix: '.min' })) - .pipe(cssnano()) // Minifies the result - .pipe(gulp.dest(paths.css)); -}); + return this.paths +} +const paths = pathsConfig() -// Javascript minification -gulp.task('scripts', function() { - return gulp.src(paths.js + '/project.js') - .pipe(plumber()) // Checks for errors - .pipe(uglify()) // Minifies the js - .pipe(rename({ suffix: '.min' })) - .pipe(gulp.dest(paths.js)); -}); +// region images +gulp.task('favicons-images', function (cb) { + pump([gulp.src(paths.imagesFavicons_files), + gulp.dest(paths.buildImagesFavicons)], + cb) +}) -// Image compression -gulp.task('imgCompression', function(){ - return gulp.src(paths.images + '/*') - .pipe(imagemin()) // Compresses PNG, JPEG, GIF and SVG images - .pipe(gulp.dest(paths.images)) -}); +gulp.task('nonfavicons-images', function (cb) { + pump([gulp.src(paths.images_files), + imagemin(), + gulp.dest(paths.buildImages)], + cb) +}) -// Run django server -gulp.task('runServer', function(cb) { - var cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'}); - cmd.on('close', function(code) { - console.log('runServer exited with code ' + code); - cb(code); - }); -}); +gulp.task('images', function () { + runSequence(['favicons-images', 'nonfavicons-images']) +}) +// endregion -// Browser sync server for live reload -gulp.task('browserSync', function() { - browserSync.init( - [paths.css + "/*.css", paths.js + "*.js", paths.templates + '*.html'], { - proxy: "localhost:8000" - }); -}); +// region scripts +gulp.task('js-scripts', function (cb) { + pump([gulp.src(paths.scriptsJs_files), + concat(paths.build_scriptsFileName), + uglify(), + rename({suffix: '.min'}), + gulp.dest(paths.build)], + cb) +}) -// Watch -gulp.task('watch', function() { +gulp.task('scripts', function () { + runSequence('js-scripts') +}) +// endregion - gulp.watch(paths.sass + '/*.scss', ['styles']); - gulp.watch(paths.js + '/*.js', ['scripts']).on("change", reload); - gulp.watch(paths.images + '/*', ['imgCompression']); - gulp.watch(paths.templates + '/**/*.html').on("change", reload); +// region styles +gulp.task('sass-styles', function (cb) { + pump([gulp.src(paths.stylesSass_files), + sass(), + gulp.dest(paths.stylesCss)], + cb + ) +}) -}); +gulp.task('css-styles', function (cb) { + pump([gulp.src(paths.stylesCss_files), + concat(paths.build_stylesFileName), + autoprefixer({browsers: ['last 2 versions']}), + pixrem(), + cleanCSS({rebaseTo: '../../'}), + rename({suffix: '.min'}), + gulp.dest(paths.build)], + cb) +}) -// Default task -gulp.task('default', function() { - runSequence(['styles', 'scripts', 'imgCompression'], 'runServer', 'browserSync', 'watch'); -}); +gulp.task('styles', function () { + runSequence('sass-styles', 'css-styles') +}) +// endregion + +// region build +gulp.task('build', function () { + runSequence(['images', 'scripts', 'styles']) +}) + +gulp.task('clean-build', function (cb) { + pump([gulp.src(paths.build), + clean()], + cb) +}) +// endregion + +gulp.task('init-browserSync', function () { + browserSync.init({ + host: 'localhost:8000' + }) +}) + +gulp.task('watch', function () { + gulp.watch(paths.images_files, ['images']).on('change', browserSync.reload) + gulp.watch(paths.scripts_files, ['scripts']).on('change', browserSync.reload) + gulp.watch(paths.styles_files, ['styles']).on('change', browserSync.reload) + gulp.watch(paths.templates_files).on('change', browserSync.reload) +}) + +gulp.task('default', function () { + runSequence('build', 'init-browserSync', 'watch') +}) diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index 0c8af4272..5a15270dd 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -16,18 +16,18 @@ "pixrem": "~1.3.1", "time-grunt": "~1.2.1" {% elif cookiecutter.js_task_runner == 'Gulp' %} - "browser-sync": "^2.14.0", - "del": "^2.2.2", + "browser-sync": "^2.18.8", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", - "gulp-cssnano": "^2.1.2", - "gulp-imagemin": "^3.0.3", + "gulp-clean": "^0.3.2", + "gulp-clean-css": "^3.0.4", + "gulp-concat": "^2.6.1", + "gulp-imagemin": "^3.1.1", "gulp-pixrem": "^1.0.0", - "gulp-plumber": "^1.1.0", "gulp-rename": "^1.2.2", - "gulp-sass": "^2.3.2", - "gulp-uglify": "^2.0.0", - "gulp-util": "^3.0.7", + "gulp-sass": "^3.1.0", + "gulp-uglify": "^2.1.2", + "pump": "^1.0.2", "run-sequence": "^1.2.2" {% endif %} }, diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css deleted file mode 100644 index 5f23c427a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css +++ /dev/null @@ -1,38 +0,0 @@ -/* These styles are generated from project.scss. */ - -.alert-debug { - color: black; - background-color: white; - border-color: #d6e9c6; -} - -.alert-error { - color: #b94a48; - background-color: #f2dede; - border-color: #eed3d7; -} - -/* This is a fix for the bootstrap4 alpha release */ -@media (max-width: 47.9em) { - .navbar-nav .nav-item { - float: none; - width: 100%; - display: inline-block; - } - - .navbar-nav .nav-item + .nav-item { - margin-left: 0; - } - - .nav.navbar-nav.pull-xs-right { - float: none !important; - } -} - -/* Display django-debug-toolbar. - See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 - and https://github.com/pydanny/cookiecutter-django/issues/317 -*/ -[hidden][style="display: block;"] { - display: block !important; -} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/images/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/images/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js deleted file mode 100644 index 91ab9e2da..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Project specific Javascript goes here. */ - -/* -Formatting hack to get around crispy-forms unfortunate hardcoding -in helpers.FormHelper: - - if template_pack == 'bootstrap4': - grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') - using_grid_layout = (grid_colum_matcher.match(self.label_class) or - grid_colum_matcher.match(self.field_class)) - if using_grid_layout: - items['using_grid_layout'] = True - -Issues with the above approach: - -1. Fragile: Assumes Bootstrap 4's API doesn't change (it does) -2. Unforgiving: Doesn't allow for any variation in template design -3. Really Unforgiving: No way to override this behavior -4. Undocumented: No mention in the documentation, or it's too hard for me to find -*/ -$('.form-group').removeClass('row'); diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js new file mode 100644 index 000000000..360177996 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js @@ -0,0 +1,21 @@ +/* Project specific Javascript goes here. */ + +/* + Formatting hack to get around crispy-forms unfortunate hardcoding + in helpers.FormHelper: + + if template_pack == 'bootstrap4': + grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') + using_grid_layout = (grid_colum_matcher.match(self.label_class) or + grid_colum_matcher.match(self.field_class)) + if using_grid_layout: + items['using_grid_layout'] = True + + Issues with the above approach: + + 1. Fragile: Assumes Bootstrap 4's API doesn't change (it does) + 2. Unforgiving: Doesn't allow for any variation in template design + 3. Really Unforgiving: No way to override this behavior + 4. Undocumented: No mention in the documentation, or it's too hard for me to find + */ +$('.form-group').removeClass('row') diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css new file mode 100644 index 000000000..6b20fb3dc --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css @@ -0,0 +1,26 @@ +.alert-debug { + background-color: #fff; + border-color: #d6e9c6; + color: #000; } + +.alert-error { + background-color: #f2dede; + border-color: #eed3d7; + color: #b94a48; } + +.navbar { + border-radius: 0px; } + +@media (max-width: 47.9em) { + .navbar-nav .nav-item { + display: inline-block; + float: none; + width: 100%; } + .navbar-nav .nav-item + .nav-item { + margin-left: 0; } + .nav.navbar-nav.pull-xs-right { + float: none !important; } } + +[hidden][style="display: block;"] { + display: block !important; } + diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss new file mode 100644 index 000000000..cc30bfcb6 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss @@ -0,0 +1,71 @@ +// project specific CSS goes here + +//////////////////////////////// +//Variables// +//////////////////////////////// + +// Alert colors + +$white: #fff; +$mint-green: #d6e9c6; +$black: #000; +$pink: #f2dede; +$dark-pink: #eed3d7; +$red: #b94a48; + +//////////////////////////////// +//Alerts// +//////////////////////////////// + +// bootstrap alert CSS, translated to the django-standard levels of +// debug, info, success, warning, error + +.alert-debug { + background-color: $white; + border-color: $mint-green; + color: $black; +} + +.alert-error { + background-color: $pink; + border-color: $dark-pink; + color: $red; +} + +//////////////////////////////// +//Navbar// +//////////////////////////////// + +// This is a fix for the bootstrap4 alpha release + +.navbar { + border-radius: 0px; +} + +@media (max-width: 47.9em) { + .navbar-nav .nav-item { + display: inline-block; + float: none; + width: 100%; + } + + .navbar-nav .nav-item + .nav-item { + margin-left: 0; + } + + .nav.navbar-nav.pull-xs-right { + float: none !important; + } +} + +//////////////////////////////// +//Django Toolbar// +//////////////////////////////// + +// Display django-debug-toolbar. +// See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 +// and https://github.com/pydanny/cookiecutter-django/issues/317 + +[hidden][style="display: block;"] { + display: block !important; +} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index e947da5b8..e49aaa216 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -20,7 +20,7 @@ {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %} - + {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endblock %} @@ -88,6 +88,13 @@ ================================================== --> {% block javascript %} + + {% if debug %} + + {% endif %} + @@ -97,7 +104,7 @@ {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} - + {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endblock javascript %} From d9f870461b7636fd727c75cf27374be1a56471c8 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 23:27:41 +0300 Subject: [PATCH 49/73] Pin mailhog Docker image to v1.0.0 (#1201) --- {{cookiecutter.project_slug}}/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/dev.yml b/{{cookiecutter.project_slug}}/dev.yml index 7a2d06eb7..715b35d97 100644 --- a/{{cookiecutter.project_slug}}/dev.yml +++ b/{{cookiecutter.project_slug}}/dev.yml @@ -45,7 +45,7 @@ services: {% if cookiecutter.use_mailhog == 'y' %} mailhog: - image: mailhog/mailhog + image: mailhog/mailhog:v1.0.0 ports: - "8025:8025" {% endif %} From 51dd0b5e73aec2d4d274d5d09f8dde81e3b53a30 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 23:29:31 +0300 Subject: [PATCH 50/73] Fix index.rst sphinx warnings (#1166) --- docs/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index e707365bf..70b8264c8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -35,5 +35,4 @@ Indices and tables * :ref:`genindex` * :ref:`search` -.. At some point it would be good to have a module index of the high level things -we are doing. Then we can * :ref:`modindex` back in. +.. At some point it would be good to have a module index of the high level things we are doing. Then we can * :ref:`modindex` back in. From 83c8594203455065f5f427625f98eb5200ab9210 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 23:29:56 +0300 Subject: [PATCH 51/73] Fix Getting Up and Running Locally With Docker doc sphinx warnings (#1165) --- docs/developing-locally-docker.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 46ee887a3..8be28c66e 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -18,12 +18,13 @@ If you don't already have it installed, follow the instructions for your OS: - On Mac OS X, you'll need `Docker for Mac`_ - On Windows, you'll need `Docker for Windows`_ - On Linux, you'll need `docker-engine`_ + .. _`Docker for Mac`: https://docs.docker.com/engine/installation/mac/ .. _`Docker for Windows`: https://docs.docker.com/engine/installation/windows/ .. _`docker-engine`: https://docs.docker.com/engine/installation/ 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``:: @@ -82,7 +83,7 @@ To migrate your app and to create a superuser, run:: Here we specify the ``django`` container as the location to run our management commands. Add your Docker development server IP ------------------------------------- +------------------------------------- When ``DEBUG`` is set to `True`, the host is validated against ``['localhost', '127.0.0.1', '[::1]']``. This is adequate when running a ``virtualenv``. For Docker, in the ``config.settings.local``, add your host development server IP to ``INTERNAL_IPS`` or ``ALLOWED_HOSTS`` if the variable exists. @@ -135,7 +136,7 @@ Then you may need to run the following for it to work as desired: django-debug-toolbar """""""""""""""""""" -In order for django-debug-toolbar to work with docker you need to add your docker-machine ip address (the output of `Get the IP ADDRESS`_) to INTERNAL_IPS in local.py +In order for django-debug-toolbar to work with docker you need to add your docker-machine ip address to ``INTERNAL_IPS`` in ``local.py`` .. May be a better place to put this, as it is not Docker specific. From cabcc7b106f7fe8e2cb041d438c18933cd7607c3 Mon Sep 17 00:00:00 2001 From: Ashish Patil Date: Wed, 21 Jun 2017 00:33:39 +0400 Subject: [PATCH 52/73] [Fix] #1173 Nginx SSL redirect loop (#1174) Headers not being passed was causing nginx to redirect to SSL again & again. --- {{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf b/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf index 10a53eec1..c3f46b84e 100755 --- a/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf +++ b/{{cookiecutter.project_slug}}/compose/nginx/nginx-secure.conf @@ -83,6 +83,8 @@ http { # cookiecutter-django app location @proxy_to_app { + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Url-Scheme $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; From 1f7be4eb57f7e8555995dd9852699b85fd555f06 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Wed, 21 Jun 2017 23:12:22 +0300 Subject: [PATCH 53/73] =?UTF-8?q?Revert=20"Node.JS=20+=20docker-compose=20?= =?UTF-8?q?=3D=20=E2=99=A5"=20(#1206)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "[Fix] #1173 Nginx SSL redirect loop (#1174)" This reverts commit cabcc7b106f7fe8e2cb041d438c18933cd7607c3. * Revert "Fix Getting Up and Running Locally With Docker doc sphinx warnings (#1165)" This reverts commit 83c8594203455065f5f427625f98eb5200ab9210. * Revert "Fix index.rst sphinx warnings (#1166)" This reverts commit 51dd0b5e73aec2d4d274d5d09f8dde81e3b53a30. * Revert "Pin mailhog Docker image to v1.0.0 (#1201)" This reverts commit d9f870461b7636fd727c75cf27374be1a56471c8. * Revert "Node.JS + docker-compose = ♥ (#1128)" This reverts commit 4b06fe3958ddae837100bcdcab001b6405a202fd. --- docs/developing-locally-docker.rst | 8 - docs/gulp-with-docker.rst | 76 ------- docs/index.rst | 2 - docs/nodejs-with-docker.rst | 45 ---- hooks/post_gen_project.py | 8 +- {{cookiecutter.project_slug}}/.gitignore | 1 - .../compose/node/Dockerfile-dev | 11 - .../config/settings/base.py | 3 +- {{cookiecutter.project_slug}}/dev.yml | 17 -- {{cookiecutter.project_slug}}/gulpfile.js | 212 ++++++++---------- {{cookiecutter.project_slug}}/package.json | 16 +- .../static/.gitkeep | 0 .../static/css/project.css | 38 ++++ .../static/images/.gitkeep | 0 .../static/js/project.js | 21 ++ .../static/scripts/.gitkeep | 0 .../static/scripts/js/project.js | 21 -- .../static/styles/.gitkeep | 0 .../static/styles/css/project.css | 26 --- .../static/styles/sass/project.scss | 71 ------ .../templates/base.html | 11 +- 21 files changed, 164 insertions(+), 423 deletions(-) delete mode 100644 docs/gulp-with-docker.rst delete mode 100644 docs/nodejs-with-docker.rst delete mode 100644 {{cookiecutter.project_slug}}/compose/node/Dockerfile-dev delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/.gitkeep create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/images/.gitkeep create mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/.gitkeep delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/.gitkeep delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css delete mode 100644 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 8be28c66e..379bc8106 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -6,8 +6,6 @@ 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. -.. _devlocdocker-prereq: - Prerequisites ------------- @@ -33,9 +31,6 @@ Currently PostgreSQL (``psycopg2`` python package) is not installed inside Docke 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. - -.. _devlocdocker-build-the-stack: - Build the Stack --------------- @@ -46,9 +41,6 @@ on your development system:: If you want to build the production environment you don't have to pass an argument -f, it will automatically use docker-compose.yml. - -.. _devlocdocker-boot-the-system: - Boot the System --------------- diff --git a/docs/gulp-with-docker.rst b/docs/gulp-with-docker.rst deleted file mode 100644 index 1e9b2a184..000000000 --- a/docs/gulp-with-docker.rst +++ /dev/null @@ -1,76 +0,0 @@ -Gulp with Docker -================ - -.. index:: gulp, gulpjs, gulpfile, gulpfilejs, docker, docker-compose - -`Gulp`_ support is provided out-of-the-box, ready for use as-is, or with any kind of customizations suiting the specific needs of the project. - -.. _`Gulp`: http://gulpjs.com/ - -*All paths are relative to the generated project's root.* - - -Prerequisites -------------- - -- These :ref:`nodewithdocker-prereq` are satisfied. - - -Overview --------- - -:ref:`nodewithdocker-overview` Node.js integration details first to get the whole picture. - -Essential aspects of Gulp integration are - -- :code:`./gulpfile.js` with Gulp tasks defined; -- :code:`./{{ cookiecutter.project_slug }}/static/build/` (build directory) with static assets built via Gulp. - -Let us take a closer look at :code:`./gulpfile.js`: - -- paths to static assets are provided by :code:`pathsConfig()`; -- for clarity, related tasks are grouped by :code:`region`: - - :code:`images`: - - :code:`images`: run image-related tasks in parallel, namely: - - :code:`favicons-images`: process favicon images only; - - :code:`nonfavicons-images`: process all images except for favicons. - - :code:`scripts`: - - :code:`scripts`: run script-related tasks in sequence, namely: - - :code:`js-scripts`: process js scripts. - - :code:`styles`: - - :code:`styles`: run script-related tasks in sequence, namely: - - :code:`sass-styles`: process SCSS styles; - - :code:`css-styles`: process CSS styles. - - :code:`build`: - - :code:`build`: run :code:`images`, :code:`scripts`, and :code:`styles` in parallel; - - :code:`clean-build`: clean up build directory: -- the :code:`default` task runs the following ones in sequence: - - :code:`build`; - - :code:`init-browserSync`: initialize `BrowserSync`_; - - :code:`watch`: watch static asset files/directories changes, running BrowserSync on any changes. - -.. _`BrowserSync`: https://www.browsersync.io/ - - -Workflow --------- - -#. [*skip if done*] :ref:`devlocdocker-build-the-stack`; -#. :ref:`devlocdocker-boot-the-system`. - -By default, :code:`gulp` command gets executed immediately after :code:`node` -container startup (see :code:`./dev.yml` for details) which in turn invokes -the :code:`default` task, so generally one would not need to run any -of the aforementioned tasks manually. However, should the need arise, -oftentimes just a few of the tasks listed above will be used to, for instance, -straightforwardly :code:`build` all assets - -.. code-block:: bash - - $ docker-compose -f dev.yml exec node gulp build - -or build :code:`scripts` selectively - -.. code-block:: bash - - $ docker-compose -f dev.yml exec node gulp scripts diff --git a/docs/index.rst b/docs/index.rst index 70b8264c8..3b0a268ca 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,8 +17,6 @@ Contents: developing-locally-docker settings linters - nodejs-with-docker - gulp-with-docker live-reloading-and-sass-compilation deployment-on-pythonanywhere deployment-on-heroku diff --git a/docs/nodejs-with-docker.rst b/docs/nodejs-with-docker.rst deleted file mode 100644 index 468c54087..000000000 --- a/docs/nodejs-with-docker.rst +++ /dev/null @@ -1,45 +0,0 @@ -Node.js with Docker -=================== - -.. index:: node, nodejs, docker, docker-compose - -`Node.js`_ support is provided out-of-the-box, ready for use as-is, or with any kind of customizations suiting the specific needs of the project. - -.. _`Node.js`: https://nodejs.org/en/ - -*All paths are relative to the generated project's root.* - - -.. _nodewithdocker-prereq: - -Prerequisites -------------- - -- The project was generated with :code:`use_docker` set to :code:`y`. -- These :ref:`devlocdocker-prereq` are met as well. - - -.. _nodewithdocker-overview: - -Overview --------- - -Essential aspects of Node.js integration are - -- node docker-compose service (:code:`node`) definition in :code:`./dev.yml`; -- :code:`./compose/node/Dockerfile-dev` defining the :code:`node` image; -- :code:`./node_modules/` 'overlayed' with :code:`/app/node_modules/`, its counterpart from the running instance of :code:`node`. - - -Workflow --------- - -#. [*skip if done*] :ref:`devlocdocker-build-the-stack`: - - when building :code:`node` image from scratch, dependencies from :code:`package.json` are installed. -#. :ref:`devlocdocker-boot-the-system`. - -To log the running :code:`node` container's activity, - -.. code-block:: bash - - $ docker-compose -f dev.yml logs node diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index c005d9e7e..5e1eff9bd 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -256,6 +256,7 @@ elif '{{ cookiecutter.js_task_runner}}'.lower() == 'grunt': else: remove_gulp_files() remove_grunt_files() + remove_packageJSON_file() # 7. Removes all certbot/letsencrypt files if it isn't going to be used if '{{ cookiecutter.use_lets_encrypt }}'.lower() != 'y': @@ -263,10 +264,11 @@ if '{{ cookiecutter.use_lets_encrypt }}'.lower() != 'y': # 8. Display a warning if use_docker and use_grunt are selected. Grunt isn't # supported by our docker config atm. -if '{{ cookiecutter.js_task_runner }}'.lower() in ['grunt'] and '{{ cookiecutter.use_docker }}'.lower() == 'y': +if '{{ cookiecutter.js_task_runner }}'.lower() in ['grunt', 'gulp'] and '{{ cookiecutter.use_docker }}'.lower() == 'y': print( - "You selected to use Docker and Grunt task runner. This is NOT supported out of the box for now. You " - "can continue to use the project like you normally would, but you will need to setup Grunt manually." + "You selected to use docker and a JS task runner. This is NOT supported out of the box for now. You " + "can continue to use the project like you normally would, but you will need to add a " + "js task runner service to your docker configuration manually." ) # 9. Removes the certbot/letsencrypt files and display a warning if use_lets_encrypt is selected and use_docker isn't. diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index 710ba625d..6a0a3029e 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -79,4 +79,3 @@ staticfiles/ .cache/ -{{ cookiecutter.project_slug }}/static/build/ diff --git a/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev b/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev deleted file mode 100644 index e53fb5049..000000000 --- a/{{cookiecutter.project_slug}}/compose/node/Dockerfile-dev +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:7.10-slim - -RUN mkdir -p /app - -COPY ./package.json /app - -WORKDIR /app - -RUN npm install && npm cache clean - -ENV PATH ./node_modules/.bin/:$PATH diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 5b07086da..274e28067 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -184,10 +184,9 @@ STATIC_ROOT = str(ROOT_DIR('staticfiles')) # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url STATIC_URL = '/static/' -_STATIC_BUILD_ROOT_DIR_NAME = 'build' # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS STATICFILES_DIRS = [ - (_STATIC_BUILD_ROOT_DIR_NAME, str(APPS_DIR.path('static').path(_STATIC_BUILD_ROOT_DIR_NAME))), + str(APPS_DIR.path('static')), ] # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders diff --git a/{{cookiecutter.project_slug}}/dev.yml b/{{cookiecutter.project_slug}}/dev.yml index 715b35d97..dbd321c82 100644 --- a/{{cookiecutter.project_slug}}/dev.yml +++ b/{{cookiecutter.project_slug}}/dev.yml @@ -21,7 +21,6 @@ services: depends_on: - postgres{% if cookiecutter.use_mailhog == 'y' %} - mailhog{% endif %} - - node environment: - POSTGRES_USER={{cookiecutter.project_slug}} - USE_DOCKER=yes @@ -49,19 +48,3 @@ services: ports: - "8025:8025" {% endif %} - - node: - build: - context: . - dockerfile: ./compose/node/Dockerfile-dev - volumes: - - .:/app - # http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html - - /app/node_modules - command: "gulp" - ports: - # BrowserSync port. - - "3000:3000" - # BrowserSync UI port. - - "3001:3001" - diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index f3278afe5..b67a7bee9 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -1,139 +1,105 @@ -const gulp = require('gulp') -const pump = require('pump') -const sass = require('gulp-sass') -const pjson = require('./package.json') -const autoprefixer = require('gulp-autoprefixer') -const cleanCSS = require('gulp-clean-css') -const rename = require('gulp-rename') -const pixrem = require('gulp-pixrem') -const concat = require('gulp-concat') -const uglify = require('gulp-uglify') -const imagemin = require('gulp-imagemin') -const clean = require('gulp-clean') -const spawn = require('child_process').spawn -const runSequence = require('run-sequence') -const browserSync = require('browser-sync').create() -const pathsConfig = function (appName) { - this.paths = {} - this.paths['app'] = './' + (appName || pjson.name) +//////////////////////////////// + //Setup// +//////////////////////////////// - this.paths['static'] = this.paths['app'] + '/static' +// Plugins +var gulp = require('gulp'), + pjson = require('./package.json'), + gutil = require('gulp-util'), + sass = require('gulp-sass'), + autoprefixer = require('gulp-autoprefixer'), + cssnano = require('gulp-cssnano'), + rename = require('gulp-rename'), + del = require('del'), + plumber = require('gulp-plumber'), + pixrem = require('gulp-pixrem'), + uglify = require('gulp-uglify'), + imagemin = require('gulp-imagemin'), + spawn = require('child_process').spawn, + runSequence = require('run-sequence'), + browserSync = require('browser-sync').create(), + reload = browserSync.reload; - this.paths['build'] = this.paths['static'] + '/build' - this.paths['buildImages'] = this.paths['build'] + '/images' - this.paths['images'] = this.paths['static'] + '/images' - this.paths['images_files'] = this.paths['images'] + '/*' - this.paths['buildImagesFavicons'] = this.paths['buildImages'] + '/favicons' - this.paths['imagesFavicons'] = this.paths['images'] + '/favicons' - this.paths['imagesFavicons_files'] = this.paths['imagesFavicons'] + '/*' +// Relative paths function +var pathsConfig = function (appName) { + this.app = "./" + (appName || pjson.name); - this.paths['build_scriptsFileName'] = 'scripts.js' - this.paths['scripts'] = this.paths['static'] + '/scripts' - this.paths['scripts_files'] = this.paths['scripts'] + '/**/*' - this.paths['scriptsJs'] = this.paths['scripts'] + '/js' - this.paths['scriptsJs_files'] = this.paths['scriptsJs'] + '/*.js' + return { + app: this.app, + templates: this.app + '/templates', + css: this.app + '/static/css', + sass: this.app + '/static/sass', + fonts: this.app + '/static/fonts', + images: this.app + '/static/images', + js: this.app + '/static/js', + } +}; - this.paths['build_stylesFileName'] = 'styles.css' - this.paths['styles'] = this.paths['static'] + '/styles' - this.paths['styles_files'] = this.paths['styles'] + '/**/*' - this.paths['stylesSass'] = this.paths['styles'] + '/sass' - this.paths['stylesSass_files'] = this.paths['stylesSass'] + '/*.scss' - this.paths['stylesCss'] = this.paths['styles'] + '/css' - this.paths['stylesCss_files'] = this.paths['stylesCss'] + '/*.css' +var paths = pathsConfig(); - this.paths['templates'] = this.paths['app'] + '/templates' - this.paths['templates_files'] = this.paths['templates'] + '/**/*.html' +//////////////////////////////// + //Tasks// +//////////////////////////////// - return this.paths -} -const paths = pathsConfig() +// Styles autoprefixing and minification +gulp.task('styles', function() { + return gulp.src(paths.sass + '/project.scss') + .pipe(sass().on('error', sass.logError)) + .pipe(plumber()) // Checks for errors + .pipe(autoprefixer({browsers: ['last 2 versions']})) // Adds vendor prefixes + .pipe(pixrem()) // add fallbacks for rem units + .pipe(gulp.dest(paths.css)) + .pipe(rename({ suffix: '.min' })) + .pipe(cssnano()) // Minifies the result + .pipe(gulp.dest(paths.css)); +}); -// region images -gulp.task('favicons-images', function (cb) { - pump([gulp.src(paths.imagesFavicons_files), - gulp.dest(paths.buildImagesFavicons)], - cb) -}) +// Javascript minification +gulp.task('scripts', function() { + return gulp.src(paths.js + '/project.js') + .pipe(plumber()) // Checks for errors + .pipe(uglify()) // Minifies the js + .pipe(rename({ suffix: '.min' })) + .pipe(gulp.dest(paths.js)); +}); -gulp.task('nonfavicons-images', function (cb) { - pump([gulp.src(paths.images_files), - imagemin(), - gulp.dest(paths.buildImages)], - cb) -}) +// Image compression +gulp.task('imgCompression', function(){ + return gulp.src(paths.images + '/*') + .pipe(imagemin()) // Compresses PNG, JPEG, GIF and SVG images + .pipe(gulp.dest(paths.images)) +}); -gulp.task('images', function () { - runSequence(['favicons-images', 'nonfavicons-images']) -}) -// endregion +// Run django server +gulp.task('runServer', function(cb) { + var cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'}); + cmd.on('close', function(code) { + console.log('runServer exited with code ' + code); + cb(code); + }); +}); -// region scripts -gulp.task('js-scripts', function (cb) { - pump([gulp.src(paths.scriptsJs_files), - concat(paths.build_scriptsFileName), - uglify(), - rename({suffix: '.min'}), - gulp.dest(paths.build)], - cb) -}) +// Browser sync server for live reload +gulp.task('browserSync', function() { + browserSync.init( + [paths.css + "/*.css", paths.js + "*.js", paths.templates + '*.html'], { + proxy: "localhost:8000" + }); +}); -gulp.task('scripts', function () { - runSequence('js-scripts') -}) -// endregion +// Watch +gulp.task('watch', function() { -// region styles -gulp.task('sass-styles', function (cb) { - pump([gulp.src(paths.stylesSass_files), - sass(), - gulp.dest(paths.stylesCss)], - cb - ) -}) + gulp.watch(paths.sass + '/*.scss', ['styles']); + gulp.watch(paths.js + '/*.js', ['scripts']).on("change", reload); + gulp.watch(paths.images + '/*', ['imgCompression']); + gulp.watch(paths.templates + '/**/*.html').on("change", reload); -gulp.task('css-styles', function (cb) { - pump([gulp.src(paths.stylesCss_files), - concat(paths.build_stylesFileName), - autoprefixer({browsers: ['last 2 versions']}), - pixrem(), - cleanCSS({rebaseTo: '../../'}), - rename({suffix: '.min'}), - gulp.dest(paths.build)], - cb) -}) +}); -gulp.task('styles', function () { - runSequence('sass-styles', 'css-styles') -}) -// endregion - -// region build -gulp.task('build', function () { - runSequence(['images', 'scripts', 'styles']) -}) - -gulp.task('clean-build', function (cb) { - pump([gulp.src(paths.build), - clean()], - cb) -}) -// endregion - -gulp.task('init-browserSync', function () { - browserSync.init({ - host: 'localhost:8000' - }) -}) - -gulp.task('watch', function () { - gulp.watch(paths.images_files, ['images']).on('change', browserSync.reload) - gulp.watch(paths.scripts_files, ['scripts']).on('change', browserSync.reload) - gulp.watch(paths.styles_files, ['styles']).on('change', browserSync.reload) - gulp.watch(paths.templates_files).on('change', browserSync.reload) -}) - -gulp.task('default', function () { - runSequence('build', 'init-browserSync', 'watch') -}) +// Default task +gulp.task('default', function() { + runSequence(['styles', 'scripts', 'imgCompression'], 'runServer', 'browserSync', 'watch'); +}); diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index 5a15270dd..0c8af4272 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -16,18 +16,18 @@ "pixrem": "~1.3.1", "time-grunt": "~1.2.1" {% elif cookiecutter.js_task_runner == 'Gulp' %} - "browser-sync": "^2.18.8", + "browser-sync": "^2.14.0", + "del": "^2.2.2", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", - "gulp-clean": "^0.3.2", - "gulp-clean-css": "^3.0.4", - "gulp-concat": "^2.6.1", - "gulp-imagemin": "^3.1.1", + "gulp-cssnano": "^2.1.2", + "gulp-imagemin": "^3.0.3", "gulp-pixrem": "^1.0.0", + "gulp-plumber": "^1.1.0", "gulp-rename": "^1.2.2", - "gulp-sass": "^3.1.0", - "gulp-uglify": "^2.1.2", - "pump": "^1.0.2", + "gulp-sass": "^2.3.2", + "gulp-uglify": "^2.0.0", + "gulp-util": "^3.0.7", "run-sequence": "^1.2.2" {% endif %} }, diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css new file mode 100644 index 000000000..5f23c427a --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/css/project.css @@ -0,0 +1,38 @@ +/* These styles are generated from project.scss. */ + +.alert-debug { + color: black; + background-color: white; + border-color: #d6e9c6; +} + +.alert-error { + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; +} + +/* This is a fix for the bootstrap4 alpha release */ +@media (max-width: 47.9em) { + .navbar-nav .nav-item { + float: none; + width: 100%; + display: inline-block; + } + + .navbar-nav .nav-item + .nav-item { + margin-left: 0; + } + + .nav.navbar-nav.pull-xs-right { + float: none !important; + } +} + +/* Display django-debug-toolbar. + See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 + and https://github.com/pydanny/cookiecutter-django/issues/317 +*/ +[hidden][style="display: block;"] { + display: block !important; +} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/images/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/images/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js new file mode 100644 index 000000000..91ab9e2da --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/js/project.js @@ -0,0 +1,21 @@ +/* Project specific Javascript goes here. */ + +/* +Formatting hack to get around crispy-forms unfortunate hardcoding +in helpers.FormHelper: + + if template_pack == 'bootstrap4': + grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') + using_grid_layout = (grid_colum_matcher.match(self.label_class) or + grid_colum_matcher.match(self.field_class)) + if using_grid_layout: + items['using_grid_layout'] = True + +Issues with the above approach: + +1. Fragile: Assumes Bootstrap 4's API doesn't change (it does) +2. Unforgiving: Doesn't allow for any variation in template design +3. Really Unforgiving: No way to override this behavior +4. Undocumented: No mention in the documentation, or it's too hard for me to find +*/ +$('.form-group').removeClass('row'); diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js deleted file mode 100644 index 360177996..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/scripts/js/project.js +++ /dev/null @@ -1,21 +0,0 @@ -/* Project specific Javascript goes here. */ - -/* - Formatting hack to get around crispy-forms unfortunate hardcoding - in helpers.FormHelper: - - if template_pack == 'bootstrap4': - grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') - using_grid_layout = (grid_colum_matcher.match(self.label_class) or - grid_colum_matcher.match(self.field_class)) - if using_grid_layout: - items['using_grid_layout'] = True - - Issues with the above approach: - - 1. Fragile: Assumes Bootstrap 4's API doesn't change (it does) - 2. Unforgiving: Doesn't allow for any variation in template design - 3. Really Unforgiving: No way to override this behavior - 4. Undocumented: No mention in the documentation, or it's too hard for me to find - */ -$('.form-group').removeClass('row') diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/.gitkeep b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css deleted file mode 100644 index 6b20fb3dc..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/css/project.css +++ /dev/null @@ -1,26 +0,0 @@ -.alert-debug { - background-color: #fff; - border-color: #d6e9c6; - color: #000; } - -.alert-error { - background-color: #f2dede; - border-color: #eed3d7; - color: #b94a48; } - -.navbar { - border-radius: 0px; } - -@media (max-width: 47.9em) { - .navbar-nav .nav-item { - display: inline-block; - float: none; - width: 100%; } - .navbar-nav .nav-item + .nav-item { - margin-left: 0; } - .nav.navbar-nav.pull-xs-right { - float: none !important; } } - -[hidden][style="display: block;"] { - display: block !important; } - diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss deleted file mode 100644 index cc30bfcb6..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/styles/sass/project.scss +++ /dev/null @@ -1,71 +0,0 @@ -// project specific CSS goes here - -//////////////////////////////// -//Variables// -//////////////////////////////// - -// Alert colors - -$white: #fff; -$mint-green: #d6e9c6; -$black: #000; -$pink: #f2dede; -$dark-pink: #eed3d7; -$red: #b94a48; - -//////////////////////////////// -//Alerts// -//////////////////////////////// - -// bootstrap alert CSS, translated to the django-standard levels of -// debug, info, success, warning, error - -.alert-debug { - background-color: $white; - border-color: $mint-green; - color: $black; -} - -.alert-error { - background-color: $pink; - border-color: $dark-pink; - color: $red; -} - -//////////////////////////////// -//Navbar// -//////////////////////////////// - -// This is a fix for the bootstrap4 alpha release - -.navbar { - border-radius: 0px; -} - -@media (max-width: 47.9em) { - .navbar-nav .nav-item { - display: inline-block; - float: none; - width: 100%; - } - - .navbar-nav .nav-item + .nav-item { - margin-left: 0; - } - - .nav.navbar-nav.pull-xs-right { - float: none !important; - } -} - -//////////////////////////////// -//Django Toolbar// -//////////////////////////////// - -// Display django-debug-toolbar. -// See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 -// and https://github.com/pydanny/cookiecutter-django/issues/317 - -[hidden][style="display: block;"] { - display: block !important; -} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index e49aaa216..e947da5b8 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -20,7 +20,7 @@ {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress css %}{% endraw %}{% endif %}{% raw %} - + {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endblock %} @@ -88,13 +88,6 @@ ================================================== --> {% block javascript %} - - {% if debug %} - - {% endif %} - @@ -104,7 +97,7 @@ {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% compress js %}{% endraw %}{% endif %}{% raw %} - + {% endraw %}{% if cookiecutter.use_compressor == "y" %}{% raw %}{% endcompress %}{% endraw %}{% endif %}{% raw %} {% endblock javascript %} From 28af86b48dd00ba0e73f6f770a663f1264fc47fe Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 23:27:41 +0300 Subject: [PATCH 54/73] Pin mailhog Docker image to v1.0.0 (#1201) From e8037d595ec726d939cf0c01ec40d41448dfdc01 Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 23:29:31 +0300 Subject: [PATCH 55/73] Fix index.rst sphinx warnings (#1166) From 10577e97d13736c3a4186ed4e566ff4d45b6ef7b Mon Sep 17 00:00:00 2001 From: Shupeyko Nikita Date: Tue, 20 Jun 2017 23:29:56 +0300 Subject: [PATCH 56/73] Fix Getting Up and Running Locally With Docker doc sphinx warnings (#1165) From 292c419001fbb289ecd0038350ac018daf29db10 Mon Sep 17 00:00:00 2001 From: Ashish Patil Date: Wed, 21 Jun 2017 00:33:39 +0400 Subject: [PATCH 57/73] [Fix] #1173 Nginx SSL redirect loop (#1174) Headers not being passed was causing nginx to redirect to SSL again & again. From 854683de3ece15e746ce7699d1ddad46a71689ce Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Jun 2017 10:15:46 -0700 Subject: [PATCH 58/73] Update django-test-plus from 1.0.17 to 1.0.18 --- {{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 437eee598..828aa5d3d 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -7,7 +7,7 @@ django-coverage-plugin==1.5.0 Sphinx==1.6.2 django-extensions==1.7.9 Werkzeug==0.12.2 -django-test-plus==1.0.17 +django-test-plus==1.0.18 factory-boy==2.8.1 django-debug-toolbar==1.8 From 50a4beed7e394855c4cc6724ccd120d063dd0896 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 26 Jun 2017 10:15:47 -0700 Subject: [PATCH 59/73] Update django-test-plus from 1.0.17 to 1.0.18 --- {{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 0889aaa4f..8e9236353 100644 --- a/{{cookiecutter.project_slug}}/requirements/test.txt +++ b/{{cookiecutter.project_slug}}/requirements/test.txt @@ -9,7 +9,7 @@ psycopg2==2.7.1 coverage==4.4.1 flake8==3.3.0 # pyup: != 2.6.0 -django-test-plus==1.0.17 +django-test-plus==1.0.18 factory-boy==2.8.1 # pytest From 1871abd7e912deeb822992f40183b1b6b93d9cbc Mon Sep 17 00:00:00 2001 From: shireenrao Date: Mon, 26 Jun 2017 15:21:32 -0400 Subject: [PATCH 60/73] Setting up new project with mailhog without docker breaks use of mailhog (#553) * add mailhog container for local development * update local settings to use mailhog container for docker * remove whitespace * remove whitespace * fix whitespace formatting * another try to fix whitespace * fix block error due to whitespace * only use mailhog in docker if docker and mailhog is chosen in setup wizard * Remove warning at end if using docker and mailhog * mailhog should work locally without docker * remove unnecessary check for docker in dev docker-compose file * Remove section within local development docs referencing docker As this document is meant as a how to for developing locally, I removed the section which was added for using mailhog in docker. I will add that section to the developing-locally-docker.rst file. Also removed jinja template as it does not work in docs. * Added a comment on mailhog for local docker development * fix hyperlink to #smtp-backend * Added a comment on mailhog for local docker development * pull docs/developing-locally-docker.rst from upstream * remove changes from dev.yml and add comment for local.py * Sync with pydanny:master --- {{cookiecutter.project_slug}}/config/settings/local.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index ff21678cf..efbaf30b2 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -4,6 +4,8 @@ Local settings - Run in Debug mode {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %} - Use mailhog for emails +{% elif cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'n' %} +- Use mailhog for emails {% else %} - Use console backend for emails {% endif %} @@ -30,6 +32,8 @@ SECRET_KEY = env('DJANGO_SECRET_KEY', default='CHANGEME!!!') EMAIL_PORT = 1025 {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %} EMAIL_HOST = env('EMAIL_HOST', default='mailhog') +{% elif cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'n' %} +EMAIL_HOST = 'localhost' {% else %} EMAIL_HOST = 'localhost' EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', From c63ba28e369213415cee26a0df8c838dcad04fef Mon Sep 17 00:00:00 2001 From: Charles Han Date: Mon, 26 Jun 2017 12:52:40 -0700 Subject: [PATCH 61/73] Change to process *.scss instead of only project.scss. (#1209) --- {{cookiecutter.project_slug}}/gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index b67a7bee9..b9358f611 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -45,7 +45,7 @@ var paths = pathsConfig(); // Styles autoprefixing and minification gulp.task('styles', function() { - return gulp.src(paths.sass + '/project.scss') + return gulp.src(paths.sass + '/*.scss') .pipe(sass().on('error', sass.logError)) .pipe(plumber()) // Checks for errors .pipe(autoprefixer({browsers: ['last 2 versions']})) // Adds vendor prefixes From 44aff9393367bd7429e259057dab20eeb86fe11e Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Tue, 27 Jun 2017 22:44:33 +0200 Subject: [PATCH 62/73] Update django-storages-redux from 1.3.2 to 1.3.3 (#1210) --- {{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 4d56f27f9..045477180 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -17,7 +17,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ boto==2.47.0 -django-storages-redux==1.3.2 +django-storages-redux==1.3.3 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.5.2 {%- endif %} From ba4869feeab51431222c09cd09234da8c33d9514 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 3 Jul 2017 19:37:08 +0200 Subject: [PATCH 63/73] Update sphinx from 1.6.2 to 1.6.3 (#1215) --- {{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 828aa5d3d..59d8596d6 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ coverage==4.4.1 django-coverage-plugin==1.5.0 -Sphinx==1.6.2 +Sphinx==1.6.3 django-extensions==1.7.9 Werkzeug==0.12.2 django-test-plus==1.0.18 From b3bf6f4f67164a4ae114c259e535ff7707b20813 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 3 Jul 2017 22:01:17 +0200 Subject: [PATCH 64/73] Update django-extensions from 1.7.9 to 1.8.0 (#1217) --- {{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 59d8596d6..c11c2f7fc 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -5,7 +5,7 @@ coverage==4.4.1 django-coverage-plugin==1.5.0 Sphinx==1.6.3 -django-extensions==1.7.9 +django-extensions==1.8.0 Werkzeug==0.12.2 django-test-plus==1.0.18 factory-boy==2.8.1 From 43b8e96cd363ce7a8ca5e852db7cc949737411a0 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Wed, 5 Jul 2017 09:30:24 +0200 Subject: [PATCH 65/73] Update pytest from 3.1.2 to 3.1.3 (#1218) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6a54b115b..2f0e67524 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ sh==1.12.14 binaryornot==0.4.3 # Testing -pytest==3.1.2 +pytest==3.1.3 pep8==1.7.0 pyflakes==1.5.0 tox==2.7.0 From 03648d3d01bcc5a0be38596e0ba1b5b1dffd97ef Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 9 Jul 2017 14:36:07 +0200 Subject: [PATCH 66/73] Update pillow from 4.1.1 to 4.2.1 (#1221) --- {{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 31724e3ab..ca9ed5328 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -23,7 +23,7 @@ django-crispy-forms==1.6.1 django-model-utils==3.0.0 # Images -Pillow==4.1.1 +Pillow==4.2.1 # Password storage argon2-cffi==16.3.0 From 57410882ae01a2bf0f5943cf70d1f9a845b52e7f Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 9 Jul 2017 14:36:22 +0200 Subject: [PATCH 67/73] Update boto from 2.47.0 to 2.48.0 (#1220) --- {{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 045477180..fca70d106 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -16,7 +16,7 @@ gunicorn==19.7.1 # Static and Media Storage # ------------------------------------------------ -boto==2.47.0 +boto==2.48.0 django-storages-redux==1.3.3 {% if cookiecutter.use_whitenoise != 'y' -%} Collectfast==0.5.2 From db451327246be046d3b93672212adec8cb4cf947 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Sun, 9 Jul 2017 14:36:38 +0200 Subject: [PATCH 68/73] Update django-extensions from 1.8.0 to 1.8.1 (#1219) --- {{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 c11c2f7fc..77f03ddb1 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -5,7 +5,7 @@ coverage==4.4.1 django-coverage-plugin==1.5.0 Sphinx==1.6.3 -django-extensions==1.8.0 +django-extensions==1.8.1 Werkzeug==0.12.2 django-test-plus==1.0.18 factory-boy==2.8.1 From afb6b79fc3de3cee751ab3d8f34ac117aa40dc2b Mon Sep 17 00:00:00 2001 From: Hamish Durkin Date: Sun, 9 Jul 2017 23:04:27 +1000 Subject: [PATCH 69/73] Updated idea run configurations to work as explained in the docs (#1223) --- CONTRIBUTORS.rst | 2 ++ .../.idea/runConfigurations/Docker__migrate.xml | 2 +- .../.idea/runConfigurations/Docker__runserver.xml | 2 +- .../.idea/runConfigurations/Docker__runserver_plus.xml | 2 +- .../.idea/runConfigurations/Docker__tests___all.xml | 2 +- .../.idea/runConfigurations/Docker__tests___class__TestUser.xml | 2 +- .../runConfigurations/Docker__tests___file__test_models.xml | 2 +- .../.idea/runConfigurations/Docker__tests___module__users.xml | 2 +- .../Docker__tests___specific__test_get_absolute_url.xml | 2 +- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 215e58ee6..4eb5b41c6 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -87,6 +87,7 @@ Listed in alphabetical order. Felipe Arruda `@arruda`_ Garry Cairns `@garry-cairns`_ Garry Polley `@garrypolley`_ + Hamish Durkin `@durkode`_ Harry Percival `@hjwp`_ Henrique G. G. Pereira `@ikkebr`_ Ian Lee `@IanLee1521`_ @@ -178,6 +179,7 @@ Listed in alphabetical order. .. _@dhepper: https://github.com/dhepper .. _@dot2dotseurat: https://github.com/dot2dotseurat .. _@dsclementsen: https://github.com/dsclementsen +.. _@durkode: https://github.com/durkode .. _@epileptic-fish: https://gihub.com/epileptic-fish .. _@eraldo: https://github.com/eraldo .. _@eriol: https://github.com/eriol diff --git a/{{cookiecutter.project_slug}}/.idea/runConfigurations/Docker__migrate.xml b/{{cookiecutter.project_slug}}/.idea/runConfigurations/Docker__migrate.xml index 18829b2f2..98fff92e8 100644 --- a/{{cookiecutter.project_slug}}/.idea/runConfigurations/Docker__migrate.xml +++ b/{{cookiecutter.project_slug}}/.idea/runConfigurations/Docker__migrate.xml @@ -6,7 +6,7 @@ -