Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Look Behind the Curtain
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Senko Rašić
November 14, 2017
Programming
0
140
Look Behind the Curtain
A Python Zagreb meetup talk about why we should not be afraid of poking into someone else's code.
Senko Rašić
November 14, 2017
Tweet
Share
More Decks by Senko Rašić
See All by Senko Rašić
Online audio and video using free software and open standards
senko
1
78
Streamanje glazbe pomoću Go-a
senko
1
100
Chasing the Ghost
senko
1
140
Real Time Web with Django Channels
senko
1
180
Building highly available and fault tolerant sites on a budget
senko
1
460
Simple REST with Django
senko
1
110
Building good Web APIs
senko
0
180
Detecting duplicate SQL queries in Django
senko
1
1k
Python 3: Zašto i kako
senko
1
180
Other Decks in Programming
See All in Programming
CSC307 Lecture 12
javiergs
PRO
0
460
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
490
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
110
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
710
CSC307 Lecture 15
javiergs
PRO
0
230
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
110
あなたはユーザーではない #PdENight
kajitack
4
340
CSC307 Lecture 13
javiergs
PRO
0
310
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
330
文字コードの話
qnighy
44
17k
Codex の「自走力」を高める
yorifuji
0
1k
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
100
Featured
See All Featured
Ethics towards AI in product and experience design
skipperchong
2
220
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
How to Ace a Technical Interview
jacobian
281
24k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
How GitHub (no longer) Works
holman
316
140k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
270
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Mind Mapping
helmedeiros
PRO
1
110
Leo the Paperboy
mayatellez
4
1.5k
Transcript
Look behind the curtain Senko Rašić
None
None
None
“When the getDVRConversions is set to True it expires conversions
automatically.” —paid support Proprietary software
Open Source
None
None
None
None
None
None
None
Sign in with Google * *authorized users only
from allauth.socialaccount.adapter import \ DefaultSocialAccountAdapter class MyAdapter(DefaultSocialAccountAdapter): def is_open_for_signup(self, request):
return False
from allauth.socialaccount.adapter import \ DefaultSocialAccountAdapter class MyAdapter(DefaultSocialAccountAdapter): def is_open_for_signup(self, req,
sociallogin): return False
from allauth.socialaccount.adapter import \ DefaultSocialAccountAdapter class MyAdapter(DefaultSocialAccountAdapter): def is_open_for_signup(self, req,
sociallogin): return False
Django Developer Tragedies AllAuth won’t log in without SocialAccount, but
won’t create SocialAccount without signup.
We need to go deeper
allauth.socialaccount.views.SignupView
a.sa.providers.google.views.oauth2_login a.sa.providers.oauth2.views.OAuth2LoginView ↓ ↓ a.sa.providers.google.views.oauth2_callback a.sa.providers.oauth2.views.OAuth2CallbackView ↓ allauth.socialaccount.views.SignupView
class OAuth2CallbackView(OAuth2View): def dispatch(self, request): … login = self.adapter.complete_login(…) …
return complete_social_login(request, login) ↓ # allauth.socialaccount.helpers def _complete_social_login(req, sociallogin): … if sociallogin.is_existing: … else: ret = _process_signup(req, sociallogin) ↓ # allauth.socialaccount.models class SocialLogin(object): @property def is_existing(self): return self.account.pk
None
# a.sa.provider.google.views class GoogleOAuth2Adapter(OAuth2Adapter): def complete_login(…): … login = self.get_provider().
\ sociallogin_from_response(…) ↓ # a.sa.providers.base class Provider(object): def sociallogin_from_response(…): … sociallogin.user = adapter.new_user(req, sociallogin) … ↓
None
# allauth.socialaccount.models class SocialLogin(object): @property def is_existing(self): return self.account.pk
None
None
# allauth.socialaccount.helpers def complete_social_login(request, sociallogin): assert not sociallogin.is_existing …
None
None
千⾥里里之⾏行行,始於⾜足下 Debugging of thousand lines starts with a single step
Thank you! @senkorasic