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
Senko Rašić
November 14, 2017
Programming
0
99
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
52
Streamanje glazbe pomoću Go-a
senko
1
60
Chasing the Ghost
senko
1
100
Real Time Web with Django Channels
senko
1
170
Building highly available and fault tolerant sites on a budget
senko
1
400
Simple REST with Django
senko
1
89
Building good Web APIs
senko
0
140
Detecting duplicate SQL queries in Django
senko
1
940
Python 3: Zašto i kako
senko
1
140
Other Decks in Programming
See All in Programming
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
570
Go の GC の不得意な部分を克服したい
taiyow
3
850
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
180
快速入門可觀測性
blueswen
0
420
CloudflareStack でRAGに入門
asahiiwm
0
120
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
260
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
740
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
200
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
200
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
190
fs2-io を試してたらバグを見つけて直した話
chencmd
0
250
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Thoughts on Productivity
jonyablonski
68
4.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
180
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
For a Future-Friendly Web
brad_frost
175
9.4k
Fireside Chat
paigeccino
34
3.1k
The World Runs on Bad Software
bkeepers
PRO
66
11k
How to Ace a Technical Interview
jacobian
276
23k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
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