From a968a9bc488fdb22bdc95c37560cc35e6709ac12 Mon Sep 17 00:00:00 2001 From: Lucas Matheus Testa Date: Sat, 29 Oct 2016 15:26:36 -0200 Subject: [PATCH 1/4] Doing login --- maoaberta/contributors/forms.py | 16 ++++++++++++++++ maoaberta/contributors/views.py | 5 ----- maoaberta/maoaberta.sqlite | Bin 0 -> 196608 bytes maoaberta/maoaberta/settings.py | 5 +++++ maoaberta/maoaberta/urls.py | 5 +++-- .../{contributors => registration}/login.html | 12 +++++++++--- 6 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 maoaberta/contributors/forms.py create mode 100644 maoaberta/maoaberta.sqlite rename maoaberta/templates/{contributors => registration}/login.html (78%) diff --git a/maoaberta/contributors/forms.py b/maoaberta/contributors/forms.py new file mode 100644 index 0000000..9f285a9 --- /dev/null +++ b/maoaberta/contributors/forms.py @@ -0,0 +1,16 @@ +from django.contrib.auth import views as auth_views +from django.forms.widgets import TextInput +from django import forms + + +class LoginForm(auth_views.forms.AuthenticationForm): + username = forms.CharField(max_length=100) + + class Meta: + widgets = { + 'username': TextInput(attrs={ + 'required': 'required', + 'focus': 'focus', + 'class': 'form-control' + }) + } diff --git a/maoaberta/contributors/views.py b/maoaberta/contributors/views.py index 08e08b9..74ed1e9 100644 --- a/maoaberta/contributors/views.py +++ b/maoaberta/contributors/views.py @@ -1,11 +1,6 @@ from django.views.generic import TemplateView -class LoginView(TemplateView): - - template_name = 'contributors/login.html' - - class ContributorView(TemplateView): template_name = 'contributors/contributor_details.html' diff --git a/maoaberta/maoaberta.sqlite b/maoaberta/maoaberta.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e05498dab9e21e3c270a6187fb8f9bd65bd9a43c GIT binary patch literal 196608 zcmeI*d2AcmeFt!kNQ$B)a%{_5dTq<5Wy>~KD~ZEXwBzp5UfHYIqIPBZkda_ABuCUp zBuAbZ+Ln-@p}bAfBM8s{y_+5=kfJDxrbYT!(gF(vEl~7sQ6vqTV$maL(-zpGO@kIl z-Ez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q`DRI`SXop{inL0-GQb;VU%_Is-Gp`k-h1#7&VSYM3vtE@7wVC7$**1IQ`pV4m)mq`+H22`f0@*h6 zi|jSJUvTq$vP?S7)V zGQBKIGqobk{ zd%2Yd_nurMu_+JkrB|lw@hgcqml@-@F)k71vX>IvrBr-;GMme0()9j6!+z64{=*9b z5P$##AOHafKmY;|fB*y_0D*ldaMn8$-07-_asK~~hka)sb`T*$00Izz00bZa0SG_< U0uX=z1R!7v40-dxt?&Q;AInqR(EtDd literal 0 HcmV?d00001 diff --git a/maoaberta/maoaberta/settings.py b/maoaberta/maoaberta/settings.py index 07123b9..5ae45c2 100644 --- a/maoaberta/maoaberta/settings.py +++ b/maoaberta/maoaberta/settings.py @@ -14,6 +14,7 @@ import os from dj_database_url import parse as parse_db_url +from django.core.urlresolvers import reverse_lazy from prettyconf import config BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -117,3 +118,7 @@ MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') + + +# Login +LOGIN_REDIRECT_URL = reverse_lazy('home') diff --git a/maoaberta/maoaberta/urls.py b/maoaberta/maoaberta/urls.py index 2f8fd88..24d5ede 100644 --- a/maoaberta/maoaberta/urls.py +++ b/maoaberta/maoaberta/urls.py @@ -15,14 +15,15 @@ """ from django.conf.urls import include, url from django.contrib import admin +from django.contrib.auth import views as auth_views -from contributors.views import LoginView +# from contributors.views import LoginView from contributors.views import ContributorView from organizations.views import HomePageView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', HomePageView.as_view(), name='home'), - url(r'^login/$', LoginView.as_view(), name='login'), + url(r'^login/$', auth_views.login, name='login'), url(r'^contributor/$', ContributorView.as_view(), name='contributor') ] diff --git a/maoaberta/templates/contributors/login.html b/maoaberta/templates/registration/login.html similarity index 78% rename from maoaberta/templates/contributors/login.html rename to maoaberta/templates/registration/login.html index 435dc2c..1c49d7e 100644 --- a/maoaberta/templates/contributors/login.html +++ b/maoaberta/templates/registration/login.html @@ -29,8 +29,8 @@

/mãoaberta

- From 1ca4ab07955dd5faa8e587898d6e7a81bd55e254 Mon Sep 17 00:00:00 2001 From: Lucas Matheus Testa Date: Sat, 29 Oct 2016 15:49:42 -0200 Subject: [PATCH 2/4] login --- maoaberta/contributors/views.py | 7 +++++++ maoaberta/maoaberta.sqlite | Bin 196608 -> 286720 bytes maoaberta/maoaberta/settings.py | 8 ++++++++ maoaberta/maoaberta/urls.py | 12 ++++++------ .../{registration => account}/login.html | 0 maoaberta/templates/base.html | 6 +++++- requirements/production.txt | 1 + 7 files changed, 27 insertions(+), 7 deletions(-) rename maoaberta/templates/{registration => account}/login.html (100%) diff --git a/maoaberta/contributors/views.py b/maoaberta/contributors/views.py index 74ed1e9..a7bd294 100644 --- a/maoaberta/contributors/views.py +++ b/maoaberta/contributors/views.py @@ -1,4 +1,11 @@ from django.views.generic import TemplateView +from django.contrib.auth import logout +from django.shortcuts import redirect + + +def logout_view(request): + logout(request) + return redirect('home') class ContributorView(TemplateView): diff --git a/maoaberta/maoaberta.sqlite b/maoaberta/maoaberta.sqlite index e05498dab9e21e3c270a6187fb8f9bd65bd9a43c..c2a9f4dc39c811fabba0e7562339e762ef3302a2 100644 GIT binary patch delta 6732 zcmbVReQX=$8Nc^@$@%kMXK8wEKAMZ2#7Pq;K0CJKrfEpi5X$3o_-8irtwE5G>u7=X>4p0WvJRD*v5*)$22td-j{P1 zpHsA|eUrQA_wA;-c?`pDRR00=^VDK*h@Qv%|9-RvJz3y2 zG-A8pf8eL^+DhHgQ?P#fUi4;b6b*EnOB(ITCDPqSIo@$R=Q!c$wSR2CXiqMe`s~6@ zbPeVkA1!1PDK5<=6507oF%SrZ;{1KZJQq)LMKtg;+P7W7z19 zPz3$$3rAuRHnMv&@)WD^6pRYl&P_EKJv>@S75M@}8;o=5BA<^ZvvXW36Q9qd?wRLxvy>-cSvD3P z2-G8MG>K#_Iq%e*2L_^{NMPt|HCR)0bS)XdIFJ0Mms~A$v!WX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RPg1QL zhsl>($JWS?TE-d~cVUi>6Yc3Ef7Wgvi(~F+4Mj79Ed$juxIh$C)tCIClMpR z%p~-=+Fa=XXU>~7qt5T=muG4fy-=^{1L0_7pkyk7x-1LIf;^<;RclgECL~U-7xIcF zhh>~g4JS?6c*asP60Z%bI43V@L*=Mch%L-!_m;BZbY07i%qOPsaFt zLV7tX6imq|<>lw4#eb8jR?^UgbXDsRT6_1a8L>FCEE+R{$nCQV`7vuG$*O_iFG7t>c<+Arzz%?*C@^9Y}8?O#lD@ diff --git a/maoaberta/maoaberta/settings.py b/maoaberta/maoaberta/settings.py index 5ae45c2..1e63a1b 100644 --- a/maoaberta/maoaberta/settings.py +++ b/maoaberta/maoaberta/settings.py @@ -19,6 +19,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +SITE_ID = 1 + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ @@ -35,11 +37,16 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', + 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + 'contributors', 'organizations', 'projects' @@ -122,3 +129,4 @@ # Login LOGIN_REDIRECT_URL = reverse_lazy('home') +LOGIN_URL = 'login' diff --git a/maoaberta/maoaberta/urls.py b/maoaberta/maoaberta/urls.py index 24d5ede..b21b5a1 100644 --- a/maoaberta/maoaberta/urls.py +++ b/maoaberta/maoaberta/urls.py @@ -15,15 +15,15 @@ """ from django.conf.urls import include, url from django.contrib import admin -from django.contrib.auth import views as auth_views - -# from contributors.views import LoginView -from contributors.views import ContributorView +from allauth.account.views import LoginView +from contributors.views import ContributorView, logout_view from organizations.views import HomePageView urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', HomePageView.as_view(), name='home'), - url(r'^login/$', auth_views.login, name='login'), - url(r'^contributor/$', ContributorView.as_view(), name='contributor') + url(r'^contributor/$', ContributorView.as_view(), name='contributor'), + url(r'^accounts/login/$', LoginView.as_view(), name='login'), + url(r'^accounts/login/$', LoginView.as_view(), name='account_signup'), + url(r'^logout/$', logout_view, name='logout'), ] diff --git a/maoaberta/templates/registration/login.html b/maoaberta/templates/account/login.html similarity index 100% rename from maoaberta/templates/registration/login.html rename to maoaberta/templates/account/login.html diff --git a/maoaberta/templates/base.html b/maoaberta/templates/base.html index 45fcabc..f98c671 100644 --- a/maoaberta/templates/base.html +++ b/maoaberta/templates/base.html @@ -44,7 +44,11 @@ diff --git a/requirements/production.txt b/requirements/production.txt index 67c73ac..3de8a5f 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -2,4 +2,5 @@ prettyconf==1.2.3 Django==1.10 Pillow==3.3.0 dj-static==0.0.6 +django-allauth==0.26.1 dj-database-url==0.4.1 From 84ca4a575aeacc5cca789ed2f0d9b9b9623c6e99 Mon Sep 17 00:00:00 2001 From: Lucas Matheus Testa Date: Sat, 29 Oct 2016 15:51:06 -0200 Subject: [PATCH 3/4] remove forms.py --- maoaberta/contributors/forms.py | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 maoaberta/contributors/forms.py diff --git a/maoaberta/contributors/forms.py b/maoaberta/contributors/forms.py deleted file mode 100644 index 9f285a9..0000000 --- a/maoaberta/contributors/forms.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.contrib.auth import views as auth_views -from django.forms.widgets import TextInput -from django import forms - - -class LoginForm(auth_views.forms.AuthenticationForm): - username = forms.CharField(max_length=100) - - class Meta: - widgets = { - 'username': TextInput(attrs={ - 'required': 'required', - 'focus': 'focus', - 'class': 'form-control' - }) - } From 5c867f7c0d5e1c8006bd94b806509c85514daa2e Mon Sep 17 00:00:00 2001 From: Lucas Matheus Testa Date: Sat, 29 Oct 2016 15:54:35 -0200 Subject: [PATCH 4/4] =?UTF-8?q?adicionado=20coment=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maoaberta/maoaberta/settings.py | 1 + maoaberta/maoaberta/urls.py | 4 ++-- maoaberta/templates/account/login.html | 13 ------------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/maoaberta/maoaberta/settings.py b/maoaberta/maoaberta/settings.py index 1e63a1b..4a6fd36 100644 --- a/maoaberta/maoaberta/settings.py +++ b/maoaberta/maoaberta/settings.py @@ -37,6 +37,7 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', + # Documentation: https://github.com/pennersr/django-allauth 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.sessions', diff --git a/maoaberta/maoaberta/urls.py b/maoaberta/maoaberta/urls.py index b21b5a1..be73f25 100644 --- a/maoaberta/maoaberta/urls.py +++ b/maoaberta/maoaberta/urls.py @@ -23,7 +23,7 @@ url(r'^admin/', include(admin.site.urls)), url(r'^$', HomePageView.as_view(), name='home'), url(r'^contributor/$', ContributorView.as_view(), name='contributor'), - url(r'^accounts/login/$', LoginView.as_view(), name='login'), - url(r'^accounts/login/$', LoginView.as_view(), name='account_signup'), + url(r'^login/$', LoginView.as_view(), name='login'), + url(r'^signout/$', LoginView.as_view(), name='account_signup'), url(r'^logout/$', logout_view, name='logout'), ] diff --git a/maoaberta/templates/account/login.html b/maoaberta/templates/account/login.html index 1c49d7e..5329e30 100644 --- a/maoaberta/templates/account/login.html +++ b/maoaberta/templates/account/login.html @@ -30,24 +30,11 @@

/mãoaberta