Skip to content

Commit

Permalink
refactor: switching to pure allauth solution, addresses #13 & #2
Browse files Browse the repository at this point in the history
  • Loading branch information
erictheise committed Mar 17, 2020
1 parent 617ab06 commit 4a16009
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 27 deletions.
7 changes: 0 additions & 7 deletions accounts/forms.py

This file was deleted.

23 changes: 21 additions & 2 deletions cmdi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,23 @@
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.staticfiles',
'django.contrib.gis',
'rest_framework',
'rest_framework_gis',
'django_countries',
'django_registration',
'allauth',
'allauth.account',
'allauth.socialaccount',
# 'allauth.socialaccount.providers.facebook',
# 'allauth.socialaccount.providers.github',
# 'allauth.socialaccount.providers.google',
# 'allauth.socialaccount.providers.instagram',
# 'allauth.socialaccount.providers.openid',
# 'allauth.socialaccount.providers.reddit',
'allauth.socialaccount.providers.stackexchange',
# 'allauth.socialaccount.providers.twitter',
'accounts',
'mdi',
'maps',
Expand Down Expand Up @@ -104,6 +115,15 @@
},
]


AUTHENTICATION_BACKENDS = (
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
)
SITE_ID = 1

WSGI_APPLICATION = 'cmdi.wsgi.application'


Expand All @@ -113,7 +133,6 @@


AUTH_USER_MODEL = 'accounts.User'
ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window


# Password validation
Expand Down
12 changes: 3 additions & 9 deletions cmdi/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"""
from django.contrib import admin
from django.urls import path, include
from django_registration.backends.activation.views import RegistrationView
from accounts.forms import UserRegistrationForm
from django.conf.urls import url
from rest_framework import routers
from mdi.views import UserViewSet, GroupViewSet, OrganizationViewSet, SectorViewSet, ToolViewSet
router = routers.DefaultRouter()
Expand All @@ -31,13 +30,8 @@
path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
path('maps/', include('maps.urls')),
path('accounts/register/', RegistrationView.as_view(
form_class=UserRegistrationForm
),
name='django_registration_register',
),
path('accounts/', include('django_registration.backends.activation.urls')),
path('accounts/', include('django.contrib.auth.urls')),
# path('accounts/', include('django.contrib.auth.urls')),
url(r'^accounts/', include('allauth.urls')),
]
urlpatterns += [
path('', include(router.urls))
Expand Down
4 changes: 2 additions & 2 deletions maps/templates/maps/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<svg class="icon logo__image" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 282.08 78.75"><defs><style>.cls-1{fill:currentColor}.cls-2{fill:none;stroke:currentColor;stroke-miterlimit:10;stroke-width:2px}</style></defs><path class="cls-1" d="M98.19 4.2q3.78 0 5.59 1.63a5.86 5.86 0 0 1 1.81 4.59 7.58 7.58 0 0 1-.72 3.27 5.67 5.67 0 0 1-2.37 2.49 9.14 9.14 0 0 1-4.51.95h-1.65v6.8h-4.7V4.2zM98 8h-1.66v5.25h1.24a4 4 0 0 0 2.35-.64 2.39 2.39 0 0 0 .91-2.1C100.84 8.88 99.9 8 98 8zm14.47 15.93h-4.67v-21h4.67zm9.94-15.47A7 7 0 0 1 127 9.82a5 5 0 0 1 1.63 4v10.11h-3.23l-.91-2.05h-.12a6.37 6.37 0 0 1-2 1.77 6.54 6.54 0 0 1-3 .55A4.8 4.8 0 0 1 116 23a4.69 4.69 0 0 1-1.32-3.67 4 4 0 0 1 1.69-3.59 9.64 9.64 0 0 1 5-1.3l2.6-.08v-.44a2 2 0 0 0-.57-1.61 2.3 2.3 0 0 0-1.56-.49 7.35 7.35 0 0 0-2.09.31c-.7.22-1.43.48-2.16.79l-1.39-3.08a11.05 11.05 0 0 1 2.82-1 15.75 15.75 0 0 1 3.39-.38zM124 17l-1.41.06a4.07 4.07 0 0 0-2.43.62 1.86 1.86 0 0 0-.69 1.53 1.5 1.5 0 0 0 .48 1.26 2.09 2.09 0 0 0 1.28.37 2.89 2.89 0 0 0 2-.71 2.4 2.4 0 0 0 .8-1.91zm14.57 3.5a6.28 6.28 0 0 0 1.32-.14 10.28 10.28 0 0 0 1.25-.36v3.43a9.55 9.55 0 0 1-1.71.55 10.22 10.22 0 0 1-2.29.22 6.48 6.48 0 0 1-2.5-.45 3.51 3.51 0 0 1-1.72-1.58 6.49 6.49 0 0 1-.62-3.11v-6.82h-1.93v-1.93l2.32-1.5 1.31-3.2h3v3.15h4v3.48h-4v6.66a1.53 1.53 0 0 0 .45 1.2 1.67 1.67 0 0 0 1.12.4zm13.98-8.26h-3.42v11.69h-4.64V12.24h-2.16V10l2.21-1.18v-.75c0-1.95.44-3.32 1.33-4.1a5.71 5.71 0 0 1 3.92-1.18A12.13 12.13 0 0 1 152 3a10.63 10.63 0 0 1 1.81.49l-1.11 3.2c-.29-.09-.61-.17-.95-.24a6.63 6.63 0 0 0-1.15-.09c-.95 0-1.43.58-1.43 1.74v.69h3.42zm15.8 4.06a8 8 0 0 1-2 5.86 7.33 7.33 0 0 1-5.48 2 7.83 7.83 0 0 1-3.83-.91 6.45 6.45 0 0 1-2.62-2.68 8.91 8.91 0 0 1-1-4.31 8 8 0 0 1 2-5.79 7.37 7.37 0 0 1 5.5-2 8 8 0 0 1 3.83.91 6.58 6.58 0 0 1 2.62 2.66 8.7 8.7 0 0 1 .98 4.26zm-10.16 0a6.61 6.61 0 0 0 .63 3.21 2.25 2.25 0 0 0 2.1 1.1 2.2 2.2 0 0 0 2.07-1.1 6.48 6.48 0 0 0 .64-3.21 6.2 6.2 0 0 0-.64-3.16 2.57 2.57 0 0 0-4.17 0 6.31 6.31 0 0 0-.63 3.16zm21.38-7.82h.8a5.89 5.89 0 0 1 .69.1l-.39 4.42a5.9 5.9 0 0 0-1.49-.14 5.31 5.31 0 0 0-1.75.29 3 3 0 0 0-1.44 1 3.52 3.52 0 0 0-.56 2.16v7.6h-4.67V8.76h3.51l.71 2.49h.2A6.1 6.1 0 0 1 177 9.3a4.35 4.35 0 0 1 2.57-.82zm21.35 0a5.39 5.39 0 0 1 3.94 1.32 5.73 5.73 0 0 1 1.34 4.2v9.89h-4.64v-8.6a4.3 4.3 0 0 0-.53-2.41 1.74 1.74 0 0 0-1.54-.76 2.18 2.18 0 0 0-2.08 1.13 7.12 7.12 0 0 0-.6 3.26v7.38h-4.64v-8.6a4.57 4.57 0 0 0-.5-2.4 1.72 1.72 0 0 0-1.55-.77 2.11 2.11 0 0 0-2.12 1.29 9 9 0 0 0-.57 3.61v6.91h-4.67V8.76h3.54l.66 1.91h.2A4.17 4.17 0 0 1 189 9.05a6.08 6.08 0 0 1 2.67-.57q3.26 0 4.56 2.16h.28A4.41 4.41 0 0 1 198.38 9a6.06 6.06 0 0 1 2.54-.52zM99.93 33.07a3.86 3.86 0 0 0-3.36 1.67 8 8 0 0 0-1.17 4.63A7.83 7.83 0 0 0 96.53 44a4 4 0 0 0 3.54 1.59 9.75 9.75 0 0 0 2.45-.32c.81-.21 1.67-.49 2.57-.82v4a12.14 12.14 0 0 1-2.62.8 15.26 15.26 0 0 1-2.87.25 9.37 9.37 0 0 1-5.14-1.27 7.48 7.48 0 0 1-2.94-3.54 13.48 13.48 0 0 1-1-5.3 12.27 12.27 0 0 1 1.09-5.28 8.42 8.42 0 0 1 3.19-3.59 9.6 9.6 0 0 1 5.11-1.3 13.65 13.65 0 0 1 5.92 1.39l-1.47 3.75a17.83 17.83 0 0 0-2.21-.88 7.22 7.22 0 0 0-2.22-.41zM122 41.55a8.07 8.07 0 0 1-2 5.86 7.33 7.33 0 0 1-5.48 2 7.83 7.83 0 0 1-3.83-.91 6.45 6.45 0 0 1-2.69-2.64 8.94 8.94 0 0 1-1-4.31 7.93 7.93 0 0 1 2-5.79 7.37 7.37 0 0 1 5.5-2 7.93 7.93 0 0 1 3.82.91A6.54 6.54 0 0 1 121 37.3a8.78 8.78 0 0 1 1 4.25zm-10.16 0a6.54 6.54 0 0 0 .63 3.2 2.22 2.22 0 0 0 2.1 1.11 2.19 2.19 0 0 0 2.07-1.11 6.41 6.41 0 0 0 .64-3.2 6.2 6.2 0 0 0-.64-3.16 2.57 2.57 0 0 0-4.17 0 6.31 6.31 0 0 0-.66 3.16zm26.73 0a8 8 0 0 1-2 5.86 7.32 7.32 0 0 1-5.48 2 7.86 7.86 0 0 1-3.83-.91 6.45 6.45 0 0 1-2.62-2.68 8.94 8.94 0 0 1-1-4.31 8 8 0 0 1 2-5.79 7.37 7.37 0 0 1 5.5-2 8 8 0 0 1 3.83.91 6.52 6.52 0 0 1 2.62 2.66 8.67 8.67 0 0 1 .98 4.26zm-10.16 0a6.54 6.54 0 0 0 .63 3.2 2.52 2.52 0 0 0 4.18 0 6.54 6.54 0 0 0 .63-3.2 6.31 6.31 0 0 0-.63-3.16 2.58 2.58 0 0 0-4.18 0 6.31 6.31 0 0 0-.63 3.16zm21.41-7.82a4.83 4.83 0 0 1 4.06 2 9.49 9.49 0 0 1 1.52 5.81 11.09 11.09 0 0 1-.75 4.35 5.92 5.92 0 0 1-2 2.65 5 5 0 0 1-2.94.9 4.78 4.78 0 0 1-2.56-.58 5.84 5.84 0 0 1-1.47-1.27h-.2c.06.35.1.72.14 1.11a12 12 0 0 1 .06 1.24v5.86H141V34h3.78l.67 1.93h.22a5.37 5.37 0 0 1 1.57-1.54 4.54 4.54 0 0 1 2.58-.66zm-1.63 3.68a2.09 2.09 0 0 0-2 .91 5.58 5.58 0 0 0-.58 2.79v.41a6.94 6.94 0 0 0 .55 3.1 2.09 2.09 0 0 0 2 1.07q2.41 0 2.41-4.2a6.16 6.16 0 0 0-.57-3.09 2 2 0 0 0-1.81-.99zm16.27-3.68a7.15 7.15 0 0 1 5.08 1.76 6.71 6.71 0 0 1 1.88 5.15v2.15h-9.59a3.35 3.35 0 0 0 1 2.38 3.58 3.58 0 0 0 2.6.88 12 12 0 0 0 2.65-.27 12.25 12.25 0 0 0 2.46-.89v3.46a9.47 9.47 0 0 1-2.38.84 16.1 16.1 0 0 1-3.12.26 9.54 9.54 0 0 1-4.07-.83 6.18 6.18 0 0 1-2.79-2.54 8.47 8.47 0 0 1-1-4.39q0-4 2-6a7.34 7.34 0 0 1 5.28-1.96zm.08 3.24a2.44 2.44 0 0 0-1.78.69 3.29 3.29 0 0 0-.84 2.12h5.22a3.22 3.22 0 0 0-.68-2 2.3 2.3 0 0 0-1.92-.78zm18.18-3.24h.8a5.89 5.89 0 0 1 .69.1l-.39 4.37a5.9 5.9 0 0 0-1.49-.14 5.31 5.31 0 0 0-1.75.29 3 3 0 0 0-1.44 1 3.52 3.52 0 0 0-.57 2.16v7.59h-4.66V34h3.5l.72 2.48h.2a6.17 6.17 0 0 1 1.81-1.94 4.29 4.29 0 0 1 2.58-.81zm9.67-.02a6.91 6.91 0 0 1 4.61 1.36 5 5 0 0 1 1.63 4v10.1h-3.23l-.91-2h-.11a5.47 5.47 0 0 1-5 2.32 4.76 4.76 0 0 1-3.38-1.23 4.65 4.65 0 0 1-1.33-3.67 4 4 0 0 1 1.7-3.59 9.49 9.49 0 0 1 5-1.3l2.59-.08v-.45a2.06 2.06 0 0 0-.56-1.6 2.3 2.3 0 0 0-1.56-.49 7.3 7.3 0 0 0-2.09.31 21.24 21.24 0 0 0-2.17.79l-1.41-3.09a11.05 11.05 0 0 1 2.82-1 15.24 15.24 0 0 1 3.4-.38zm1.61 8.56h-1.41a4.13 4.13 0 0 0-2.43.63 1.86 1.86 0 0 0-.69 1.53 1.5 1.5 0 0 0 .48 1.26 2.12 2.12 0 0 0 1.29.37 2.86 2.86 0 0 0 2-.71 2.44 2.44 0 0 0 .8-1.92zm14.55 3.48a6.12 6.12 0 0 0 1.31-.14 11 11 0 0 0 1.26-.36v3.43a9.67 9.67 0 0 1-1.72.55 10.22 10.22 0 0 1-2.29.22 6.52 6.52 0 0 1-2.5-.45 3.44 3.44 0 0 1-1.71-1.58 6.4 6.4 0 0 1-.62-3.11v-6.82h-1.94v-1.93l2.32-1.5 1.27-3.2h3V34h4v3.48h-4v6.66a1.53 1.53 0 0 0 .44 1.2 1.68 1.68 0 0 0 1.18.41zM215.79 28a3.27 3.27 0 0 1 1.75.44 1.82 1.82 0 0 1 .73 1.71 1.83 1.83 0 0 1-.73 1.7 3.28 3.28 0 0 1-1.75.46 3.38 3.38 0 0 1-1.79-.46 1.83 1.83 0 0 1-.73-1.7 1.82 1.82 0 0 1 .73-1.71 3.37 3.37 0 0 1 1.79-.44zm2.29 6v15.17h-4.64V34zm7.29 15.17L219.6 34h4.86l2.76 8.78c.09.32.18.7.26 1.15a8.66 8.66 0 0 1 .16 1.23h.11a7.29 7.29 0 0 1 .15-1.2 10.14 10.14 0 0 1 .29-1.15L231 34h4.83l-5.77 15.16zM239.71 28a3.27 3.27 0 0 1 1.75.44 1.82 1.82 0 0 1 .73 1.71 1.83 1.83 0 0 1-.73 1.7 3.28 3.28 0 0 1-1.75.46 3.32 3.32 0 0 1-1.78-.46 1.84 1.84 0 0 1-.74-1.7 1.82 1.82 0 0 1 .74-1.71 3.31 3.31 0 0 1 1.78-.44zm2.29 6v15.17h-4.64V34zm14.28 10.59a4.37 4.37 0 0 1-1.56 3.56 7.5 7.5 0 0 1-4.87 1.3 17.82 17.82 0 0 1-2.81-.19 11.08 11.08 0 0 1-2.41-.69v-3.76a13.79 13.79 0 0 0 2.76.93 11.66 11.66 0 0 0 2.43.31 3.22 3.22 0 0 0 1.52-.27.88.88 0 0 0 .47-.78.92.92 0 0 0-.24-.63 2.88 2.88 0 0 0-.94-.62c-.47-.23-1.16-.54-2.08-.93a11.45 11.45 0 0 1-2.23-1.17 4 4 0 0 1-1.32-1.47 4.56 4.56 0 0 1-.43-2.11 3.63 3.63 0 0 1 1.66-3.25 8 8 0 0 1 4.44-1.09 11.76 11.76 0 0 1 2.77.31 13.89 13.89 0 0 1 2.68.94l-1.33 3.15a16.19 16.19 0 0 0-2.18-.81 7.35 7.35 0 0 0-1.94-.3c-1.07 0-1.6.28-1.6.83a.78.78 0 0 0 .24.57 3.5 3.5 0 0 0 .91.55c.45.21 1.11.5 2 .87a14.2 14.2 0 0 1 2.21 1.1 3.9 3.9 0 0 1 1.38 1.45 4.54 4.54 0 0 1 .47 2.2zm20.53-10.86a5.45 5.45 0 0 1 3.94 1.27 5.77 5.77 0 0 1 1.33 4.25v9.88h-4.64v-8.55a4.31 4.31 0 0 0-.52-2.41 1.76 1.76 0 0 0-1.55-.76 2.15 2.15 0 0 0-2.07 1.13 7 7 0 0 0-.61 3.26v7.37h-4.64v-8.59a4.47 4.47 0 0 0-.5-2.4 1.68 1.68 0 0 0-1.54-.77 2.12 2.12 0 0 0-2.12 1.25 9.24 9.24 0 0 0-.56 3.61v6.9h-4.67V34h3.53l.67 1.9h.19a4.18 4.18 0 0 1 1.81-1.61 6 6 0 0 1 2.67-.57q3.25 0 4.55 2.16h.28a4.43 4.43 0 0 1 1.91-1.62 6.06 6.06 0 0 1 2.54-.53zM99.93 58.32A3.86 3.86 0 0 0 96.57 60a8 8 0 0 0-1.17 4.63 7.83 7.83 0 0 0 1.13 4.6 4 4 0 0 0 3.54 1.58 9.74 9.74 0 0 0 2.45-.31c.81-.21 1.67-.49 2.57-.82v4a12.14 12.14 0 0 1-2.62.8 15.26 15.26 0 0 1-2.87.25 9.37 9.37 0 0 1-5.14-1.27 7.53 7.53 0 0 1-2.94-3.54 13.48 13.48 0 0 1-1-5.3 12.27 12.27 0 0 1 1.09-5.28 8.36 8.36 0 0 1 3.19-3.59 9.6 9.6 0 0 1 5.11-1.3 13.47 13.47 0 0 1 3 .35 14 14 0 0 1 2.93 1l-1.47 3.76a17.83 17.83 0 0 0-2.21-.88 7.22 7.22 0 0 0-2.23-.36zM122 66.8a8.07 8.07 0 0 1-2 5.86 7.33 7.33 0 0 1-5.48 2 7.83 7.83 0 0 1-3.83-.91 6.45 6.45 0 0 1-2.69-2.64 8.94 8.94 0 0 1-1-4.31 7.92 7.92 0 0 1 2-5.79 7.37 7.37 0 0 1 5.5-2 7.93 7.93 0 0 1 3.82.91 6.54 6.54 0 0 1 2.68 2.63 8.78 8.78 0 0 1 1 4.25zm-10.16 0a6.54 6.54 0 0 0 .63 3.2 2.22 2.22 0 0 0 2.1 1.11 2.19 2.19 0 0 0 2.04-1.11 6.41 6.41 0 0 0 .64-3.2 6.2 6.2 0 0 0-.64-3.16 2.57 2.57 0 0 0-4.17 0 6.31 6.31 0 0 0-.63 3.16zm21.57-7.8a5.66 5.66 0 0 1 3.88 1.31 5.44 5.44 0 0 1 1.48 4.24v9.89h-4.64v-8.61a4.33 4.33 0 0 0-.53-2.37 1.82 1.82 0 0 0-1.66-.8 2.29 2.29 0 0 0-2.3 1.25 8.62 8.62 0 0 0-.6 3.61v6.9h-4.66V59.26h3.53l.64 2h.22a4.57 4.57 0 0 1 1.92-1.67 6.27 6.27 0 0 1 2.72-.59zM153 69.84a4.37 4.37 0 0 1-1.56 3.56 7.53 7.53 0 0 1-4.88 1.3 17.68 17.68 0 0 1-2.8-.19 11 11 0 0 1-2.42-.69v-3.76a13.76 13.76 0 0 0 2.76.92 11.11 11.11 0 0 0 2.43.32A3.19 3.19 0 0 0 148 71a.88.88 0 0 0 .47-.78 1 1 0 0 0-.23-.63 3 3 0 0 0-.94-.62c-.47-.23-1.17-.54-2.09-.93A11.34 11.34 0 0 1 143 66.9a4.19 4.19 0 0 1-1.3-1.47 4.56 4.56 0 0 1-.43-2.11 3.63 3.63 0 0 1 1.66-3.25 8 8 0 0 1 4.46-1.07 11.73 11.73 0 0 1 2.76.31 14.27 14.27 0 0 1 2.68.93l-1.33 3.15a16.48 16.48 0 0 0-2.18-.8 7.28 7.28 0 0 0-1.93-.3c-1.07 0-1.61.28-1.61.83a.74.74 0 0 0 .24.56 3.65 3.65 0 0 0 .91.56q.67.32 2 .87a13.77 13.77 0 0 1 2.21 1.1 4.06 4.06 0 0 1 1.38 1.45 4.63 4.63 0 0 1 .48 2.18zm16.43-3.04a8.07 8.07 0 0 1-2 5.86 7.36 7.36 0 0 1-5.49 2 7.82 7.82 0 0 1-3.82-.91 6.47 6.47 0 0 1-2.63-2.68 9.06 9.06 0 0 1-1-4.31 7.92 7.92 0 0 1 2-5.79 7.37 7.37 0 0 1 5.5-2 7.93 7.93 0 0 1 3.82.91 6.54 6.54 0 0 1 2.63 2.66 8.78 8.78 0 0 1 .99 4.26zm-10.17 0a6.53 6.53 0 0 0 .64 3.2 2.22 2.22 0 0 0 2.1 1.11 2.19 2.19 0 0 0 2.07-1.11 6.41 6.41 0 0 0 .64-3.2 6.2 6.2 0 0 0-.64-3.16 2.57 2.57 0 0 0-4.17 0 6.3 6.3 0 0 0-.64 3.16zm21.41-7.8h.81a5.89 5.89 0 0 1 .69.1l-.39 4.36a6.62 6.62 0 0 0-1.49-.13 5.37 5.37 0 0 0-1.76.29 2.9 2.9 0 0 0-1.43 1 3.52 3.52 0 0 0-.57 2.16v7.59h-4.67V59.26h3.51l.72 2.48h.19a6.29 6.29 0 0 1 1.81-1.94 4.33 4.33 0 0 1 2.58-.8zm10.72 12a6.28 6.28 0 0 0 1.32-.14 10.28 10.28 0 0 0 1.29-.36v3.43a9.82 9.82 0 0 1-1.71.55 10.28 10.28 0 0 1-2.29.22 6.3 6.3 0 0 1-2.5-.46 3.44 3.44 0 0 1-1.72-1.57 6.52 6.52 0 0 1-.62-3.11v-6.82h-1.93V60.8l2.32-1.49 1.27-3.2h3v3.15h4v3.48h-4v6.66a1.56 1.56 0 0 0 .44 1.2 1.71 1.71 0 0 0 1.13.4zm7.24-17.76a3.25 3.25 0 0 1 1.75.44 2.33 2.33 0 0 1 0 3.41 3.26 3.26 0 0 1-1.75.46 3.34 3.34 0 0 1-1.78-.46 2.36 2.36 0 0 1 0-3.41 3.34 3.34 0 0 1 1.78-.44zm2.29 6v15.18h-4.64V59.26zm17.46.02v15.16h-3.53l-.61-1.93H214a4.19 4.19 0 0 1-2 1.69 6.73 6.73 0 0 1-2.65.52 5.65 5.65 0 0 1-3.85-1.31 5.34 5.34 0 0 1-1.5-4.24v-9.89h4.67v8.59a4.43 4.43 0 0 0 .51 2.35 1.81 1.81 0 0 0 1.64.8 2.33 2.33 0 0 0 2.3-1.24 8.54 8.54 0 0 0 .6-3.6v-6.9zm21.3-.26a5.45 5.45 0 0 1 3.94 1.31 5.76 5.76 0 0 1 1.38 4.22v9.89h-4.64v-8.59a4.3 4.3 0 0 0-.53-2.41 1.75 1.75 0 0 0-1.55-.76 2.15 2.15 0 0 0-2.07 1.13 7.08 7.08 0 0 0-.61 3.26v7.37h-4.64v-8.59a4.58 4.58 0 0 0-.49-2.4 1.7 1.7 0 0 0-1.55-.77 2.1 2.1 0 0 0-2.11 1.25 9 9 0 0 0-.57 3.61v6.9h-4.67V59.26h3.54l.66 1.9h.19a4.23 4.23 0 0 1 1.81-1.61 6.05 6.05 0 0 1 2.63-.55q3.25 0 4.56 2.16h.27a4.49 4.49 0 0 1 1.91-1.62 6.06 6.06 0 0 1 2.54-.54z"></path><path class="cls-2" d="M39.38 55.13l-18-51.75-18 51.75h12.37v20.25H27V55.13h12.38z"></path><path class="cls-2" d="M75.38 55.13l-18-51.75-18 51.75h12.37v20.25H63V55.13h12.38z"></path><circle class="cls-1" cx="21.38" cy="3.38" r="3.38"></circle><circle class="cls-1" cx="57.38" cy="3.38" r="3.38"></circle><circle class="cls-1" cx="39.38" cy="55.13" r="3.38"></circle><circle class="cls-1" cx="51.75" cy="55.13" r="3.38"></circle><circle class="cls-1" cx="63" cy="55.13" r="3.38"></circle><circle class="cls-1" cx="3.38" cy="55.13" r="3.38"></circle><circle class="cls-1" cx="15.75" cy="55.13" r="3.38"></circle><circle class="cls-1" cx="27" cy="55.13" r="3.38"></circle><circle class="cls-1" cx="51.75" cy="75.38" r="3.38"></circle><circle class="cls-1" cx="63" cy="75.38" r="3.38"></circle><circle class="cls-1" cx="15.75" cy="75.38" r="3.38"></circle><circle class="cls-1" cx="27" cy="75.38" r="3.38"></circle><circle class="cls-1" cx="75.38" cy="55.13" r="3.38"></circle></svg> <span class="screen-reader-text">Platform Cooperativism Consortium</span>
</a>
<div class="nav">
<p><a class="link--inverse" rel="external" href="https://platform.coop/open-access-and-privacy-policy/">Our open access and privacy policy</a></p>
<p><a class="link--inverse" rel="external" href="https://platform.coop/diversity-inclusion/">Our commitment to diversity and inclusion</a></p>
<p><a class="link--inverse" href="{% url 'privacy_policy' %}">Our privacy policy</a></p>
<p><a class="link--inverse" href="{% url 'terms_of_service' %}">Our terms of service</a></p>
</div>
</div>
<div class="column">
Expand Down
4 changes: 2 additions & 2 deletions maps/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
path('profile/', views.profile, name='profile'),
path('organizations/<int:organization_id>', views.organization_detail, name='organization_detail'),
path('individuals/<int:user_id>', views.individual_detail, name='individual_detail'),
path('privacy-policy/', PrivacyPolicyView.as_view(), {'name': 'privacy_policy', 'title': 'Privacy Policy'}),
path('terms-of-service/', TermsOfServiceView.as_view(), {'name': 'terms_of_service', 'title': 'Terms of Service'}),
path('privacy-policy/', PrivacyPolicyView.as_view(), {'title': 'Privacy Policy'}, name='privacy_policy'),
path('terms-of-service/', TermsOfServiceView.as_view(), {'title': 'Terms of Service'}, name='terms_of_service'),
]
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ chardet==3.0.4
confusable-homoglyphs==3.2.0
coreapi==2.3.3
coreschema==0.0.4
defusedxml==0.6.0
dj-database-url==0.5.0
Django==3.0.3
django-allauth==0.41.0
django-countries==5.5
django-dotenv==1.4.2
django-lockdown==3.0.0
django-registration==3.1
django-ses==0.8.14
djangorestframework==3.11.0
djangorestframework-gis==0.15
Expand All @@ -28,13 +29,16 @@ jsonschema==3.2.0
Markdown==3.1.1
MarkupSafe==1.1.1
more-itertools==8.1.0
oauthlib==3.1.0
packaging==20.0
psycopg2==2.8.4
pyparsing==2.4.6
pyrsistent==0.15.7
python3-openid==3.1.0
pytz==2019.3
PyYAML==5.3
requests==2.22.0
requests-oauthlib==1.3.0
ruamel.yaml==0.16.5
ruamel.yaml.clib==0.2.0
six==1.14.0
Expand Down
53 changes: 53 additions & 0 deletions templates/account/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% extends "account/base.html" %}

{% load i18n %}
{% load account socialaccount %}

{% block title %}{% trans "Sign In" %}{% endblock %}

{% block content %}
<div class="page-header">
<p><a class="link--inverse" href="{% url 'index' %}">Home</a></p>
<h1>{% trans "Sign In" %}</h1>
</div>

{% get_providers as socialaccount_providers %}

{% if socialaccount_providers %}
<p>{% blocktrans with site.name as site_name %}Please sign in with one
of your existing third party accounts. {% endblocktrans %}</p>

<div class="socialaccount_ballot">
<ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul>

<div class="login-or">{% trans 'or' %}</div>

</div>

{% include "socialaccount/snippets/login_extra.html" %}

{% else %}
<p>{% blocktrans %}If you have not created an account yet, then please
<a href="{{ signup_url }}">sign up</a> first.{% endblocktrans %}</p>
{% endif %}

<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
{{ form.as_p }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}

<div class="spacer"></div>
<button id="button" type="submit" class="button">
<span class="button__label">{% trans "Sign In" %}</span>
</button>

<p><a href="{% url 'account_reset_password' %}">Lost password?</a></p>
<p><a href="{{ signup_url }}">Create an account</a></p>

</form>

{% endblock %}
28 changes: 28 additions & 0 deletions templates/account/logout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% trans "Sign Out" %}{% endblock %}

{% block content %}
<div class="page-header">
<p><a class="link--inverse" href="{% url 'index' %}">Home</a></p>
<h1>{% trans "Sign Out" %}</h1>
</div>

<p>{% trans 'Are you sure you want to sign out?' %}</p>

<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
{% endif %}

<div class="spacer"></div>
<button id="button" type="submit" class="button">
<span class="button__label">{% trans "Sign Out" %}</span>
</button>

</form>

{% endblock %}
Loading

0 comments on commit 4a16009

Please sign in to comment.