diff --git a/CHANGELOG.md b/CHANGELOG.md index b3ef2dbe..e7dec781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ 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] +### Added +- You can now enable or disable user registration using the ACCOUNT_ALLOW_REGISTRATION setting. (@ddiazpinto) +### 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) + +### Changed +- Minor fixes in the docker documentation (@jayfk) +- Made @burhan a core committer (@pydanny) + ## [2015-12-30] ### Changed - Fixed a bug where the navbar was not displayed correctly (@jvanbrug) @@ -75,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) @@ -85,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 @@ -201,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 diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 2beaf5f4..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. @@ -8,14 +11,15 @@ and are able to accept and merge pull requests. Name Github Twitter =========================== ============= =========== Daniel Roy Greenfeld `@pydanny`_ @pydanny -Audrey Roy Greenfeld* `@audreyr`_ -Jim Munro -Fábio C. Barrionuevo da Luz @luzfcb +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.* +*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 @@ Jannis Gebauer `@jayfk`_ .. _@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 @@ -64,6 +60,7 @@ Listed in alphabetical order Cristian Vargas `@cdvv7788`_ Cullen Rhodes `@c-rhodes`_ Daniele Tricoli `@eriol`_ + David Díaz `@ddiazpinto`_ @DavidDiazPinto Davur Clementsen `@dsclementsen`_ @davur Eyad Al Sibai `@eyadsibai`_ Felipe Arruda `@arruda`_ @@ -143,3 +140,13 @@ Listed in alphabetical order .. _@knitatoms: https://github.com/knitatoms .. _@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 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", 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 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}}/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 %} 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 @@ + + + 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)