Merge lp:~raj-abhilash1/postorius/postorius_standalone into lp:~mailman-coders/postorius/postorius_standalone

Proposed by Abhilash Raj
Status: Merged
Merged at revision: 12
Proposed branch: lp:~raj-abhilash1/postorius/postorius_standalone
Merge into: lp:~mailman-coders/postorius/postorius_standalone
Diff against target: 100 lines (+24/-22)
2 files modified
settings.py (+22/-20)
urls.py (+2/-2)
To merge this branch: bzr merge lp:~raj-abhilash1/postorius/postorius_standalone
Reviewer Review Type Date Requested Status
Mailman Coders Pending
Review via email: mp+251951@code.launchpad.net

Description of the change

Replace django-social-auth with django-browserid for python3 compatibility.

To post a comment you must log in.
14. By Abhilash Raj

added logger and modified username algo

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'settings.py'
2--- settings.py 2014-11-24 13:37:35 +0000
3+++ settings.py 2015-03-09 10:11:30 +0000
4@@ -92,8 +92,7 @@
5
6 AUTHENTICATION_BACKENDS = (
7 'django.contrib.auth.backends.ModelBackend',
8- 'social_auth.backends.OpenIDBackend',
9- 'social_auth.backends.browserid.BrowserIDBackend',
10+ 'django_browserid.auth.BrowserIDBackend',
11 )
12
13 TEMPLATE_CONTEXT_PROCESSORS = (
14@@ -106,9 +105,6 @@
15 "django.core.context_processors.csrf",
16 "django.contrib.messages.context_processors.messages",
17 "postorius.context_processors.postorius",
18- 'social_auth.context_processors.social_auth_by_name_backends',
19- 'social_auth.context_processors.social_auth_backends',
20- 'social_auth.context_processors.social_auth_by_type_backends',
21 )
22
23 MIDDLEWARE_CLASSES = (
24@@ -144,7 +140,7 @@
25 'django.contrib.admin',
26 'django.contrib.staticfiles',
27 'postorius',
28- 'social_auth',
29+ 'django_browserid',
30 # These are only used for development
31 # 'debug_toolbar',
32 # 'django_nose',
33@@ -152,23 +148,13 @@
34 LOGIN_URL = '/postorius/accounts/login/'
35 LOGIN_REDIRECT_URL = '/postorius/'
36 LOGIN_ERROR_URL = '/postorius/accounts/login/'
37-SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete'
38-SOCIAL_AUTH_DEFAULT_USERNAME = 'new_social_auth_user'
39-SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
40-SOCIAL_AUTH_SESSION_EXPIRATION = False
41
42-SOCIAL_AUTH_PIPELINE = (
43- 'social_auth.backends.pipeline.social.social_auth_user',
44- 'social_auth.backends.pipeline.associate.associate_by_email',
45- 'social_auth.backends.pipeline.user.get_username',
46- 'social_auth.backends.pipeline.user.create_user',
47- 'social_auth.backends.pipeline.social.associate_user',
48- 'social_auth.backends.pipeline.social.load_extra_data',
49- 'social_auth.backends.pipeline.user.update_user_details'
50-)
51+def username(email):
52+ return email
53+BROWSERID_USERNAME_ALGO = username
54
55 # These settings are only needed to run the test suite:
56-#
57+#
58 TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
59 # NOSE_ARGS = [
60 # '--with-coverage',
61@@ -185,3 +171,19 @@
62 from settings_local import *
63 except ImportError:
64 pass
65+
66+LOGGING = {
67+ 'version': 1,
68+ 'handlers': {
69+ 'console':{
70+ 'level': 'DEBUG',
71+ 'class': 'logging.StreamHandler'
72+ },
73+ },
74+ 'loggers': {
75+ 'django_browserid': {
76+ 'handlers': ['console'],
77+ 'level': 'DEBUG',
78+ }
79+ },
80+}
81
82=== modified file 'urls.py'
83--- urls.py 2013-03-22 17:30:34 +0000
84+++ urls.py 2015-03-09 10:11:30 +0000
85@@ -26,13 +26,13 @@
86 admin.autodiscover()
87
88 # Import mailman urls and set urlpatterns if you want to hook
89-# mailman_django into an existing django site.
90+# mailman_django into an existing django site.
91 # Otherwise set ROOT_URLCONF in settings.py to
92 # `mailman_django.urls`.
93 # from mailman_django import urls as mailman_urls
94
95 urlpatterns = patterns('',
96+ url('', include('django_browserid.urls')),
97 url(r'^$', 'postorius.views.list_index'),
98 (r'^postorius/', include('postorius.urls')),
99- url(r'', include('social_auth.urls')),
100 )

Subscribers

People subscribed via source and target branches