From cc1da172f4ee46ab2ca8ea550fa92633976086d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz?= Date: Sat, 5 Dec 2015 20:12:53 +0100 Subject: [PATCH 01/11] [IMP] django-allauth configuration: Allow enable or disable user registration using ACCOUNT_ALLOW_REGISTRATION setting. --- CONTRIBUTORS.rst | 1 + docs/settings.rst | 7 +++++++ .../config/settings/common.py | 3 +++ .../{{cookiecutter.repo_name}}/users/adapter.py | 14 ++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/adapter.py diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 51bac95b..0646e668 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -69,6 +69,7 @@ Code Contributors * Jan Van Bruggen / @jvanbrug * Jon Miller / @jondelmil * Thomas Korrison / @failsafe86 +* David Díaz / @DavidDiazPinto * \* Possesses commit rights diff --git a/docs/settings.rst b/docs/settings.rst index 629e60f4..aec7c513 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -45,3 +45,10 @@ DJANGO_OPBEAT_APP_ID OPBEAT['APP_ID'] n/a DJANGO_OPBEAT_SECRET_TOKEN OPBEAT['SECRET_TOKEN'] n/a raises error DJANGO_OPBEAT_ORGANIZATION_ID OPBEAT['ORGANIZATION_ID'] n/a raises error ======================================= =========================== ============================================== ====================================================================== + +-------------- +Other Settings +-------------- + +ACCOUNT_ALLOW_REGISTRATION (=True) + Allow enable or disable user registration through `django-allauth` without disabling other characteristics like authentication and account management. \ No newline at end of file diff --git a/{{cookiecutter.repo_name}}/config/settings/common.py b/{{cookiecutter.repo_name}}/config/settings/common.py index a0ab6063..0a5deebe 100644 --- a/{{cookiecutter.repo_name}}/config/settings/common.py +++ b/{{cookiecutter.repo_name}}/config/settings/common.py @@ -211,6 +211,9 @@ AUTHENTICATION_BACKENDS = ( ACCOUNT_AUTHENTICATION_METHOD = 'username' ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_VERIFICATION = 'mandatory' +ACCOUNT_ADAPTER = '{{cookiecutter.repo_name}}.users.adapter.AccountAdapter' +SOCIALACCOUNT_ADAPTER = '{{cookiecutter.repo_name}}.users.adapter.SocialAccountAdapter' +ACCOUNT_ALLOW_REGISTRATION = True # Custom user app defaults # Select the correct user model diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/adapter.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/adapter.py new file mode 100644 index 00000000..1d4dda1c --- /dev/null +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/adapter.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from django.conf import settings +from allauth.account.adapter import DefaultAccountAdapter +from allauth.socialaccount.adapter import DefaultSocialAccountAdapter + + +class AccountAdapter(DefaultAccountAdapter): + def is_open_for_signup(self, request): + return getattr(settings, 'ACCOUNT_ALLOW_REGISTRATION', True) + + +class SocialAccountAdapter(DefaultSocialAccountAdapter): + def is_open_for_signup(self, request): + return getattr(settings, 'ACCOUNT_ALLOW_REGISTRATION', True) From 438ccf1b824afed9db476c5e602a6e8ceb4e87f5 Mon Sep 17 00:00:00 2001 From: Eric Zaporzan Date: Sat, 2 Jan 2016 03:33:35 -0500 Subject: [PATCH 02/11] Added cdn link to Tether, which is a new requirement for Bootstrap 4 (specifically tooltips). --- .../{{cookiecutter.repo_name}}/templates/base.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html index 9f2d6f5b..bb1a07de 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/templates/base.html @@ -95,6 +95,9 @@ + + + From 65e2d411a0e187a871443677fdfd69478f9554d8 Mon Sep 17 00:00:00 2001 From: Jannis Gebauer Date: Mon, 4 Jan 2016 11:52:26 +0100 Subject: [PATCH 03/11] tweaked docker docs --- 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 335171dd..d1b7aa2e 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -54,6 +54,7 @@ To create a persistent folder, log into the virtual machine by running:: $ docker-machine ssh dev1 $ sudo su + $ mkdir /data $ echo 'ln -sfn /mnt/sda1/data /data' >> /var/lib/boot2docker/bootlocal.sh In case you are wondering why you can't use a host volume to keep the files on @@ -100,8 +101,8 @@ using the ``docker-compose run`` command. To migrate your app and to create a superuser, run:: - $ docker-compose run django python manage.py migrate - $ docker-compose run django python manage.py createsuperuser + $ docker-compose -f dev.yml run django python manage.py migrate + $ docker-compose -f dev.yml run django python manage.py createsuperuser Here we specify the ``django`` container as the location to run our management commands. @@ -130,4 +131,4 @@ If you want to run the stack in detached mode (in the background), use the ``-d` :: - $ docker-compose up -d + $ docker-compose -f dev.yml up -d From 150577120a9a0ebf4e1de33ad2fa7e2ebe55db28 Mon Sep 17 00:00:00 2001 From: Jannis Gebauer Date: Mon, 4 Jan 2016 11:54:09 +0100 Subject: [PATCH 04/11] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3ef2dbe..ce0ca77d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All enhancements and patches to cookiecutter-django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2015-1-4] +### Changed +- Minor fixes in the docker documentation (@jayfk) + ## [2015-12-30] ### Changed - Fixed a bug where the navbar was not displayed correctly (@jvanbrug) From 49a57e7c6bafd8bf45585f95277eb01decd9186a Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Mon, 4 Jan 2016 13:54:59 -0800 Subject: [PATCH 05/11] Made @burhan a core committer --- CHANGELOG.md | 1 + CONTRIBUTORS.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce0ca77d..9039da80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [2015-1-4] ### Changed - Minor fixes in the docker documentation (@jayfk) +- Made @burhan a core committer (@pydanny) ## [2015-12-30] ### Changed diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 2beaf5f4..8b363e0c 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -8,11 +8,11 @@ and are able to accept and merge pull requests. Name Github Twitter =========================== ============= =========== Daniel Roy Greenfeld `@pydanny`_ @pydanny -Audrey Roy Greenfeld* `@audreyr`_ -Jim Munro +Audrey Roy Greenfeld* `@audreyr`_ @audreyr Fábio C. Barrionuevo da Luz @luzfcb Saurabh Kumar `@theskumar`_ @_theskumar Jannis Gebauer `@jayfk`_ +Burhan Khalid `@burhan`_ @burhan =========================== ============= =========== *Audrey is also the maintainer of cookiecutter.* From a5abee415038bc1be09b5bdd8d9fc3d84fd5dcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Mon, 4 Jan 2016 19:40:23 -0300 Subject: [PATCH 06/11] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9039da80..8c1b68de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All enhancements and patches to cookiecutter-django will be documented in this f This project adheres to [Semantic Versioning](http://semver.org/). ## [2015-1-4] +### Added +- Add Tether.js because [is needed](http://v4-alpha.getbootstrap.com/components/tooltips/#overview) for proper positioning of Bootstrap tooltips (@EricZaporzan) + ### Changed - Minor fixes in the docker documentation (@jayfk) - Made @burhan a core committer (@pydanny) From 8f03fc443b97e51596ecf62769534489e0cc2b23 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 6 Jan 2016 09:58:18 +0100 Subject: [PATCH 07/11] postgres 9.5 has arrived --- CHANGELOG.md | 4 ++++ {{cookiecutter.repo_name}}/dev.yml | 2 +- {{cookiecutter.repo_name}}/docker-compose.yml | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c1b68de..cae0765c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All enhancements and patches to cookiecutter-django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2015-1-6] +### Changed +- Use Postgres 9.5 on docker (@jayfk) + ## [2015-1-4] ### Added - Add Tether.js because [is needed](http://v4-alpha.getbootstrap.com/components/tooltips/#overview) for proper positioning of Bootstrap tooltips (@EricZaporzan) diff --git a/{{cookiecutter.repo_name}}/dev.yml b/{{cookiecutter.repo_name}}/dev.yml index d50959d2..d018f7cd 100644 --- a/{{cookiecutter.repo_name}}/dev.yml +++ b/{{cookiecutter.repo_name}}/dev.yml @@ -1,5 +1,5 @@ postgres: - image: postgres + image: postgres:9.5 volumes: # If you are using boot2docker, postgres data has to live in the VM for now until #581 is fixed # for more info see here: https://github.com/boot2docker/boot2docker/issues/581 diff --git a/{{cookiecutter.repo_name}}/docker-compose.yml b/{{cookiecutter.repo_name}}/docker-compose.yml index 01f5d68b..dc681037 100644 --- a/{{cookiecutter.repo_name}}/docker-compose.yml +++ b/{{cookiecutter.repo_name}}/docker-compose.yml @@ -1,5 +1,5 @@ postgres: - image: postgres:9.4 + image: postgres:9.5 volumes: - /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data env_file: .env @@ -40,4 +40,4 @@ celerybeat: - postgres - redis command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO -{% endif %} \ No newline at end of file +{% endif %} From 97c582dd8b12f24be3c0277781aebf2810d8164a Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Wed, 6 Jan 2016 21:44:05 -0800 Subject: [PATCH 08/11] Minor cleanup to Contributors. --- CONTRIBUTORS.rst | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index f49a26d8..5cc6504c 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -1,5 +1,8 @@ -Code Contributors -================= +Contributors +============ + +Core Developers +---------------- These contributors have commit flags for the repository, and are able to accept and merge pull requests. @@ -9,13 +12,14 @@ Name Github Twitter =========================== ============= =========== Daniel Roy Greenfeld `@pydanny`_ @pydanny Audrey Roy Greenfeld* `@audreyr`_ @audreyr -Fábio C. Barrionuevo da Luz @luzfcb +Fábio C. Barrionuevo da Luz `@luzfcb`_ Saurabh Kumar `@theskumar`_ @_theskumar Jannis Gebauer `@jayfk`_ Burhan Khalid `@burhan`_ @burhan =========================== ============= =========== -*Audrey is also the maintainer of cookiecutter.* +*Audrey is also the creator of Cookiecutter. Audrey and +Daniel are on the Cookiecutter core team.* .. _@pydanny: https://github.com/pydanny .. _@luzfcb: https://github.com/luzfcb @@ -23,18 +27,10 @@ Burhan Khalid `@burhan`_ @burhan .. _@audreyr: https://github.com/audreyr .. _@jayfk: https://github.com/jayfk -Special Thanks --------------- +Other Contributors +------------------- -The following haven't provided code directly, but have provided guidance and advice. - -* Jannis Leidel (django-configurations) -* Nate Aune -* Barry Morrison - -Contributors ------------- -Listed in alphabetical order +Listed in alphabetical order. ========================== ============================ ============== Name Github Twitter @@ -145,3 +141,12 @@ Listed in alphabetical order .. _@Travistock: https://github.com/Tavistock .. _@jvanbrug: https://github.com/jvanbrug .. _@ddiazpinto: https://github.com/ddiazpinto + +Special Thanks +~~~~~~~~~~~~~~ + +The following haven't provided code directly, but have provided guidance and advice. + +* Jannis Leidel +* Nate Aune +* Barry Morrison From a63ab00de25c21dbaccca7ae29216060c75ae0e4 Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Wed, 6 Jan 2016 21:47:14 -0800 Subject: [PATCH 09/11] Add #432 to changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cae0765c..76b9166e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All enhancements and patches to cookiecutter-django will be documented in this f This project adheres to [Semantic Versioning](http://semver.org/). ## [2015-1-6] +### Added +- You can now enable or disable user registration using the ACCOUNT_ALLOW_REGISTRATION setting. (@ddiazpinto) ### Changed - Use Postgres 9.5 on docker (@jayfk) From 0637ba63ee8fef4227e454ba0bb3209a569e455c Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Thu, 7 Jan 2016 09:36:36 -0800 Subject: [PATCH 10/11] Fix Markdown formatting of changelog. --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76b9166e..e7dec781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,7 +89,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [2015-11-18] ### Added -- Mailhog as a replacement for Maildump (@keybits ) +- Mailhog as a replacement for Maildump (@keybits) ### Removed - Maildump because it didn't support Python 3 (@keybits) @@ -99,7 +99,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - initial configuration to support opbeat (@burhan) ### Removed -- Took *.pyc out of .gitignore, because it's already covered by *.py[cod] (@audreyr) +- Took `*.pyc` out of .gitignore, because it's already covered by `*.py[cod]` (@audreyr) ## [2015-11-16] ### Changed @@ -215,7 +215,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [2015-10-11] ### Changed -- Fixed raven issue on development (#302) (@jazztpt ) +- Fixed raven issue on development (#302) (@jazztpt) ## [2015-10-05] ### Changed From 32a61e8678f05eb5ea158b003d387c4d5a8219ff Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Thu, 7 Jan 2016 12:30:36 -0800 Subject: [PATCH 11/11] Modernize the date --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 162d6b38..925a7550 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,7 +7,7 @@ "domain_name": "example.com", "version": "0.1.0", "timezone": "UTC", - "now": "2015/11/04", + "now": "2016/01/07", "year": "{{ cookiecutter.now[:4] }}", "use_whitenoise": "y", "use_celery": "n",