Merge lp:~nataliabidart/locolander/allauth into lp:locolander

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
Approved revision: 22
Merged at revision: 22
Proposed branch: lp:~nataliabidart/locolander/allauth
Merge into: lp:locolander
Diff against target: 205 lines (+53/-43)
7 files modified
locolander/locolander/settings.py (+34/-6)
locolander/locolander/urls.py (+1/-5)
locolander/locolanderweb/templates/base.html (+8/-3)
locolander/locolanderweb/templates/registration/logged_out.html (+0/-6)
locolander/locolanderweb/templates/registration/login.html (+0/-14)
locolander/locolanderweb/urls.py (+1/-6)
requirements.txt (+9/-3)
To merge this branch: bzr merge lp:~nataliabidart/locolander/allauth
Reviewer Review Type Date Requested Status
Matias Bordese Approve
Review via email: mp+176034@code.launchpad.net

Commit message

- Added integration with django-allauth. Currently supported backends are Twitter and Github.

To post a comment you must log in.
Revision history for this message
Matias Bordese (matiasb) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'locolander/locolander/settings.py'
2--- locolander/locolander/settings.py 2013-07-13 21:24:32 +0000
3+++ locolander/locolander/settings.py 2013-07-20 23:56:26 +0000
4@@ -33,7 +33,7 @@
5 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
6 # although not all choices may be available on all operating systems.
7 # In a Windows environment this must be set to your system time zone.
8-TIME_ZONE = 'America/Chicago'
9+TIME_ZONE = 'UTC'
10
11 # Language code for this installation. All choices can be found here:
12 # http://www.i18nguy.com/unicode/language-identifiers.html
13@@ -125,13 +125,41 @@
14 'django.contrib.sites',
15 'django.contrib.messages',
16 'django.contrib.staticfiles',
17- # Uncomment the next line to enable the admin:
18 'django.contrib.admin',
19- # Uncomment the next line to enable admin documentation:
20- # 'django.contrib.admindocs',
21+ 'djcelery',
22 'locolanderweb',
23 'south',
24- 'djcelery',
25+ 'allauth',
26+ 'allauth.account',
27+ 'allauth.socialaccount',
28+ # ... include the providers you want to enable:
29+ #'allauth.socialaccount.providers.bitly',
30+ #'allauth.socialaccount.providers.facebook',
31+ 'allauth.socialaccount.providers.github',
32+ #'allauth.socialaccount.providers.google',
33+ #'allauth.socialaccount.providers.linkedin',
34+ #'allauth.socialaccount.providers.openid',
35+ 'allauth.socialaccount.providers.twitter',
36+)
37+
38+AUTHENTICATION_BACKENDS = (
39+ # Needed to login by username in Django admin, regardless of `allauth`
40+ "django.contrib.auth.backends.ModelBackend",
41+ # `allauth` specific authentication methods, such as login by e-mail
42+ "allauth.account.auth_backends.AuthenticationBackend",
43+)
44+
45+TEMPLATE_CONTEXT_PROCESSORS = (
46+ 'django.contrib.auth.context_processors.auth',
47+ 'django.core.context_processors.debug',
48+ 'django.core.context_processors.i18n',
49+ 'django.core.context_processors.media',
50+ 'django.core.context_processors.request',
51+ 'django.core.context_processors.static',
52+ 'django.core.context_processors.tz',
53+ 'django.contrib.messages.context_processors.messages',
54+ 'allauth.account.context_processors.account',
55+ 'allauth.socialaccount.context_processors.socialaccount',
56 )
57
58 # A sample logging configuration. The only tangible logging
59@@ -169,7 +197,7 @@
60
61 BROKER_URL = 'redis://localhost:6379/0'
62
63-LOGIN_URL = '/login/'
64+LOGIN_URL = '/accounts/login/'
65 LOGIN_REDIRECT_URL = '/'
66
67 # local settings
68
69=== modified file 'locolander/locolander/urls.py'
70--- locolander/locolander/urls.py 2013-07-13 17:04:08 +0000
71+++ locolander/locolander/urls.py 2013-07-20 23:56:26 +0000
72@@ -8,12 +8,8 @@
73 '',
74 # Examples:
75 url(r'', include('locolanderweb.urls')),
76-
77- # Uncomment the admin/doc line below to enable admin documentation:
78- # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
79-
80- # Uncomment the next line to enable the admin:
81 url(r'^admin/', include(admin.site.urls)),
82+ url(r'^accounts/', include('allauth.urls')),
83 )
84
85 # enable staticfiles for gunicorn
86
87=== modified file 'locolander/locolanderweb/templates/base.html'
88--- locolander/locolanderweb/templates/base.html 2013-06-21 20:26:50 +0000
89+++ locolander/locolanderweb/templates/base.html 2013-07-20 23:56:26 +0000
90@@ -1,4 +1,5 @@
91 {% load staticfiles %}
92+{% load i18n %}
93
94 <html>
95 <head>
96@@ -17,10 +18,14 @@
97 </a>
98 <ul id="nav">
99 {% if user.is_authenticated %}
100- <li><a href="{% url 'project-list' %}">Your projects</a></li>
101- <li><a href="{% url 'logout' %}">Logout</a></li>
102+ <li>
103+ {% blocktrans %}Signed in as {{ user }}{% endblocktrans %}
104+ </li>
105+ <li><a href="{% url 'project-list' %}">{% trans "Your projects" %}</a></li>
106+ <li><a href="{% url 'account_logout' %}">{% trans "Logout" %}</a></li>
107 {% else %}
108- <li><a href="{% url 'login' %}">Login</a></li>
109+ <li><a href="{% url 'account_login' %}">{% trans "Sign In" %}</a></li>
110+ <li><a href="{% url 'account_signup' %}">{% trans "Sign Up" %}</a></li>
111 {% endif %}
112 </div>
113 </div>
114
115=== removed directory 'locolander/locolanderweb/templates/registration'
116=== removed file 'locolander/locolanderweb/templates/registration/logged_out.html'
117--- locolander/locolanderweb/templates/registration/logged_out.html 2013-06-21 20:26:50 +0000
118+++ locolander/locolanderweb/templates/registration/logged_out.html 1970-01-01 00:00:00 +0000
119@@ -1,6 +0,0 @@
120-{% extends "base.html" %}
121-
122-{% block content %}
123-<h1>You've been logged out.</h1>
124-<p><a href="{% url 'login' %}">Login back again</a></p>
125-{% endblock content %}
126
127=== removed file 'locolander/locolanderweb/templates/registration/login.html'
128--- locolander/locolanderweb/templates/registration/login.html 2013-06-21 20:26:50 +0000
129+++ locolander/locolanderweb/templates/registration/login.html 1970-01-01 00:00:00 +0000
130@@ -1,14 +0,0 @@
131-{% extends "base.html" %}
132-
133-{% block content %}
134-<form action="." method="POST">
135- {% csrf_token %}
136- <table id="login">
137- {{ form.as_table }}
138- </table>
139- <div class="actions">
140- <input type="submit" name="login" value="Login">
141- </div>
142- <input type="hidden" name="next" value="{{ next }}" />
143-</form>
144-{% endblock content %}
145
146=== modified file 'locolander/locolanderweb/urls.py'
147--- locolander/locolanderweb/urls.py 2013-07-06 23:19:29 +0000
148+++ locolander/locolanderweb/urls.py 2013-07-20 23:56:26 +0000
149@@ -1,12 +1,7 @@
150 from django.conf.urls import patterns, url
151
152+
153 urlpatterns = patterns(
154- 'django.contrib.auth.views',
155- url(r'^login/$', 'login', name='login'),
156- url(r'^logout/$', 'logout_then_login', name='logout'),
157-)
158-
159-urlpatterns += patterns(
160 'locolanderweb.views',
161 url(r'^$', 'home', name='home'),
162 url(r'^projects/$', 'project_list', name='project-list'),
163
164=== modified file 'requirements.txt'
165--- requirements.txt 2013-07-13 21:31:32 +0000
166+++ requirements.txt 2013-07-20 23:56:26 +0000
167@@ -1,10 +1,15 @@
168+Django==1.5.1
169+PyYAML==3.10
170+South==0.8.1
171 amqp==1.0.12
172 anyjson==0.3.3
173+argparse==1.2.1
174 billiard==2.7.3.31
175 bzr==2.6b2
176 celery==3.0.21
177 cssselect==0.8
178-Django==1.5.1
179+distribute==0.6.34
180+django-allauth==0.12.0
181 django-celery==3.0.17
182 flower==0.5.2
183 github3.py==0.7.0
184@@ -20,18 +25,19 @@
185 meld3==0.6.10
186 mock==1.0.1
187 oauth==1.0.1
188+oauthlib==0.5.0
189 pep8==1.4.6
190 psycopg2==2.5.1
191 pyflakes==0.7.3
192 pyquery==1.2.4
193 python-dateutil==2.1
194+python-openid==2.2.5
195 pytz==2013b
196-PyYAML==3.10
197 redis==2.7.6
198 requests==1.2.3
199+requests-oauthlib==0.3.2
200 simplejson==3.3.0
201 six==1.3.0
202-South==0.8.1
203 supervisor==3.0b2
204 testresources==0.2.7
205 tornado==3.1

Subscribers

People subscribed via source and target branches

to all changes: